-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\mdnieman\Desktop\PSRM replication\PSRM_Robust.log
  log type:  text
 opened on:  12 Dec 2017, 15:28:58

. /*******************************/
> /*  Mark David Nieman & Cameron G Thies */
> /*  9/15/2017       */
> /*  PRights Regimes, Tech Innovation, and FDI  */
> /*  Hierarchical Model, 1970-2010   */
> /*  Robustness   */
> /*  Stata 14.1/MP    */
> /*******************************/
> 
> /*  Note: Replication requires ado file -grinter- to plot figures R25 and R27 */
> /*     available at http://myweb.uiowa.edu/fboehmke/stata */
> 
> clear;

. clear matrix;

. program drop _all;

. set emptycells drop ;

. set seed 200;

. tempfile temp temp_efw;

. use psrm_prr_robust, clear;

. xtset ccode year;
       panel variable:  ccode (unbalanced)
        time variable:  year, 1970 to 2010
                delta:  1 unit

. /* Set up data */
> gen ln_battle =  battlerela;
(7,442 missing values generated)

.         replace ln_battle = 0 if ln_battle==. ;
(7,442 real changes made)

.         replace ln_battle = ln(ln_battle+.01);
(8,148 real changes made)

. gen log_battle =  battlerela;
(7,442 missing values generated)

.         replace log_battle = 0 if log_battle==. ;
(7,442 real changes made)

.         replace log_battle = log(log_battle+.01);
(8,148 real changes made)

. gen ln_durable = ln(durable+.01);
(2,220 missing values generated)

. gen lnbit_count = ln(bit_count+.01);
(3,280 missing values generated)

. gen fdi_cen =  FDI_net_inflows;
(2,610 missing values generated)

.         replace fdi_cen = 0 if FDI_net_inflows<0;
(429 real changes made)

.         replace fdi_cen = ln(fdi_cen+0.01);
(5,538 real changes made)

. /* Report percent of FDI set at zero or negative net FDI values to $10,000, reported in "Censoring net FDI prior to Logging" section of appendix  */
> sum FDI_net_inflows;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
FDI_net_in~s |      5,538    3.909682    19.91905  -25.09314   636.9207

. sum FDI_net_inflows if FDI_net_inflows<0;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
FDI_net_in~s |        429   -.5908622    2.485103  -25.09314  -2.74e-18

.         di 429/5538;
.07746479

.                 /* Center variables */
>         foreach var of varlist efw2legalrights xconst GDPgrowth ln_GDP2005US ln_resource 
>                                                         ruralpopul  ln_pop ln_battle ln_durable TradePctGDP 
>                                                         lnbit_count ln_World_FDI  lji kaopen ln_GDP_pc2005USD 
>                                                         polity2 ln_pec
>                                                         {;
  2.                 quietly sum `var';
  3.                 gen c`var' = `var'-r(mean);
  4.         };
(6,299 missing values generated)
(2,480 missing values generated)
(2,793 missing values generated)
(1,689 missing values generated)
(167 missing values generated)
(258 missing values generated)
(217 missing values generated)
(2,220 missing values generated)
(2,999 missing values generated)
(3,280 missing values generated)
(167 missing values generated)
(1,428 missing values generated)
(2,216 missing values generated)
(1,689 missing values generated)
(2,290 missing values generated)
(1,724 missing values generated)

.         gen cPRdemoc = cefw2legalrights*cxconst;
(6,459 missing values generated)

.         gen cPRpolity = cefw2legalrights*cpolity2;
(6,421 missing values generated)

.         gen clji_democ = clji*cxconst;
(2,691 missing values generated)

. save `temp', replace;
(note: file C:\Users\mdnieman\AppData\Local\Temp\ST_04000001.tmp not found)
file C:\Users\mdnieman\AppData\Local\Temp\ST_04000001.tmp saved

. /* Robustness: Specification*/
> 
> /* Replicate main analysis with LJI data*/
> 
>         /* Table M1 Model 1 */
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows clji_democ clji cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1386.2952  
Iteration 1:   log likelihood =  1386.2952  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,148
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,148
                                                              avg =    4,148.0
                                                              max =      4,148

                                                Wald chi2(10)     =     311.50
Log likelihood =  1386.2952                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        clji_democ |   .0557584   .0104621     5.33   0.000     .0352531    .0762637
              clji |    .031228   .0481397     0.65   0.517    -.0631242    .1255801
           cxconst |  -.0084911   .0040886    -2.08   0.038    -.0165046   -.0004777
     cln_GDP2005US |    .045704   .0075227     6.08   0.000     .0309598    .0604482
 cln_GDP_pc2005USD |   .0238562   .0106896     2.23   0.026      .002905    .0448074
        cGDPgrowth |   -.000809   .0005218    -1.55   0.121    -.0018318    .0002137
      cTradePctGDP |   .0008073   .0001535     5.26   0.000     .0005064    .0011082
           ckaopen |   .0061025   .0030297     2.01   0.044     .0001643    .0120407
      cln_resource |  -.0254995   .0050656    -5.03   0.000    -.0354278   -.0155711
        cln_battle |  -.0012422     .00107    -1.16   0.246    -.0033392    .0008549
             _cons |   3.394326   .0171547   197.87   0.000     3.360703    3.427949
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1383944   .0097907       .120476    .1589777
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0553569   .0074686      .0424942    .0721131
-----------------------------+------------------------------------------------
                sd(Residual) |   .1623114   .0018399      .1587451    .1659578
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1679.59               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 egen id_lji = group(ccode) if e(sample)==1;
(4000 missing values generated)

.                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k_t_lji = e(k);

.                 matrix L_t_lji = e(ll);

.                 svmat k_t_lji;

.                 svmat L_t_lji;

.                 gen AIC_t_lji = 2*k_t_lji1 - 2*L_t_lji1;
(8,147 missing values generated)

.                 sum AIC_t_lji;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
   AIC_t_lji |          1    -2744.59           .   -2744.59   -2744.59

.                                         /* Correlation between the two property rights measures, reported in footnote in independent variables subsection */
>                 corr cefw2legalrights clji if e(sample)==1;
(obs=1,530)

             | cefw2l~s     clji
-------------+------------------
cefw2legal~s |   1.0000
        clji |   0.7212   1.0000


.                                                 /* Figure M1 */
>                         /* Collapse to show the marginal effect of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* Create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off) 
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate. Displayed value is from 
> model 1 of Table M1.")
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure M1. Marginal Effects of Property Rights on FDI.")
>                                 t2("(LJI, all years)");

.                                         graph save Figure_M1, replace;
(note: file Figure_M1.gph not found)
(file Figure_M1.gph saved)

.         /* Table M1 Model 2 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.clji_democ#year c.clji#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year , mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1782.6058  
Iteration 1:   log likelihood =  1783.6457  
Iteration 2:   log likelihood =  1783.6888  
Iteration 3:   log likelihood =  1783.6888  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,148
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,148
                                                              avg =    4,148.0
                                                              max =      4,148

                                                Wald chi2(88)     =    1966.19
Log likelihood =  1783.6888                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
 year#c.clji_democ |
             1970  |  -.0227547   .0253836    -0.90   0.370    -.0725057    .0269962
             1971  |  -.0550739   .0247256    -2.23   0.026    -.1035352   -.0066125
             1972  |  -.0568894   .0242001    -2.35   0.019    -.1043207    -.009458
             1973  |  -.0543112   .0240525    -2.26   0.024    -.1014533   -.0071691
             1974  |  -.0494736   .0236151    -2.09   0.036    -.0957583   -.0031888
             1975  |  -.0435562   .0229758    -1.90   0.058     -.088588    .0014756
             1976  |  -.0488458   .0219471    -2.23   0.026    -.0918614   -.0058303
             1977  |  -.0304609    .020634    -1.48   0.140    -.0709028     .009981
             1978  |  -.0341795   .0211267    -1.62   0.106    -.0755871    .0072281
             1979  |  -.0296277   .0207846    -1.43   0.154    -.0703649    .0111094
             1980  |  -.0228503   .0206981    -1.10   0.270    -.0634178    .0177172
             1981  |  -.0258435   .0203597    -1.27   0.204    -.0657477    .0140608
             1982  |  -.0312476   .0203347    -1.54   0.124     -.071103    .0086077
             1983  |  -.0287496   .0204639    -1.40   0.160     -.068858    .0113588
             1984  |  -.0308316     .02055    -1.50   0.134     -.071109    .0094458
             1985  |   -.032116   .0202874    -1.58   0.113    -.0718785    .0076465
             1986  |  -.0177188   .0201452    -0.88   0.379    -.0572027    .0217652
             1987  |  -.0041687   .0202669    -0.21   0.837    -.0438911    .0355538
             1988  |   .0028058    .020125     0.14   0.889    -.0366385    .0422501
             1989  |   .0081318   .0206327     0.39   0.693    -.0323077    .0485712
             1990  |   .0023913   .0207651     0.12   0.908    -.0383075    .0430901
             1991  |  -.0260198    .022402    -1.16   0.245    -.0699269    .0178873
             1992  |  -.0252029   .0230128    -1.10   0.273     -.070307    .0199013
             1993  |  -.0011481   .0243058    -0.05   0.962    -.0487866    .0464903
             1994  |   .0006133   .0245872     0.02   0.980    -.0475768    .0488034
             1995  |   .0081391   .0242697     0.34   0.737    -.0394285    .0557068
             1996  |   .0130091   .0222432     0.58   0.559    -.0305866    .0566049
             1997  |   .0318079   .0214985     1.48   0.139    -.0103284    .0739443
             1998  |   .0752908   .0230891     3.26   0.001      .030037    .1205446
             1999  |   .1136499   .0229859     4.94   0.000     .0685983    .1587016
             2000  |   .1718597   .0229557     7.49   0.000     .1268674     .216852
             2001  |   .0849347   .0229091     3.71   0.000     .0400337    .1298356
             2002  |   .0631712    .022277     2.84   0.005     .0195091    .1068334
             2003  |   .0321332   .0221923     1.45   0.148    -.0113629    .0756293
             2004  |   .0048948   .0224925     0.22   0.828    -.0391897    .0489792
             2005  |   .1018291   .0231279     4.40   0.000     .0564992     .147159
             2006  |    .172072   .0232391     7.40   0.000     .1265242    .2176199
             2007  |   .2410031    .023325    10.33   0.000      .195287    .2867192
             2008  |   .1651029   .0242157     6.82   0.000      .117641    .2125648
             2009  |   .1058808   .0256225     4.13   0.000     .0556616       .1561
                   |
       year#c.clji |
             1970  |   -.172753   .0789251    -2.19   0.029    -.3274434   -.0180625
             1971  |  -.2591226   .0773974    -3.35   0.001    -.4108187   -.1074265
             1972  |   -.281843   .0762211    -3.70   0.000    -.4312336   -.1324524
             1973  |  -.2668947   .0755654    -3.53   0.000    -.4150002   -.1187892
             1974  |  -.2204041    .075769    -2.91   0.004    -.3689086   -.0718995
             1975  |  -.2666866   .0741631    -3.60   0.000    -.4120437   -.1213295
             1976  |  -.2615862   .0722043    -3.62   0.000    -.4031041   -.1200683
             1977  |   -.206829   .0689114    -3.00   0.003     -.341893   -.0717651
             1978  |  -.2050469   .0688929    -2.98   0.003    -.3400744   -.0700193
             1979  |   -.180002    .067616    -2.66   0.008    -.3125269   -.0474771
             1980  |  -.1546374   .0678587    -2.28   0.023     -.287638   -.0216369
             1981  |  -.1986065   .0672252    -2.95   0.003    -.3303655   -.0668475
             1982  |  -.2360342   .0670402    -3.52   0.000    -.3674306   -.1046378
             1983  |   -.226051   .0676718    -3.34   0.001    -.3586852   -.0934168
             1984  |  -.2055443   .0676718    -3.04   0.002    -.3381785   -.0729101
             1985  |  -.1861582   .0672407    -2.77   0.006    -.3179476   -.0543689
             1986  |  -.1494342   .0668109    -2.24   0.025    -.2803813   -.0184872
             1987  |  -.0989101   .0670263    -1.48   0.140    -.2302792    .0324589
             1988  |  -.0869059   .0670467    -1.30   0.195    -.2183149    .0445032
             1989  |  -.0735262   .0683763    -1.08   0.282    -.2075412    .0604888
             1990  |  -.0826886   .0686094    -1.21   0.228    -.2171606    .0517834
             1991  |  -.1268079   .0713675    -1.78   0.076    -.2666856    .0130699
             1992  |  -.1546789   .0725686    -2.13   0.033    -.2969107    -.012447
             1993  |  -.1441004   .0736803    -1.96   0.050    -.2885112    .0003103
             1994  |  -.1276912   .0740923    -1.72   0.085    -.2729094     .017527
             1995  |  -.0610692   .0729031    -0.84   0.402    -.2039566    .0818182
             1996  |  -.0590366   .0683007    -0.86   0.387    -.1929035    .0748303
             1997  |  -.0276367   .0674757    -0.41   0.682    -.1598866    .1046133
             1998  |   .0745694   .0697731     1.07   0.285    -.0621835    .2113222
             1999  |   .1695707   .0697498     2.43   0.015     .0328635    .3062778
             2000  |   .3331575   .0687533     4.85   0.000     .1984035    .4679115
             2001  |   .1543877   .0691279     2.23   0.026     .0188994     .289876
             2002  |   .0981269   .0676279     1.45   0.147    -.0344213     .230675
             2003  |   .0291934   .0677625     0.43   0.667    -.1036186    .1620054
             2004  |  -.0457587   .0686069    -0.67   0.505    -.1802258    .0887084
             2005  |   .1174327   .0686812     1.71   0.087    -.0171801    .2520454
             2006  |   .1999317   .0682315     2.93   0.003     .0662003     .333663
             2007  |   .3085489   .0681925     4.52   0.000     .1748941    .4422036
             2008  |   .1727068   .0697377     2.48   0.013     .0360235    .3093901
             2009  |  -.0031364   .0715495    -0.04   0.965    -.1433708     .137098
                   |
           cxconst |   .0037298      .0037     1.01   0.313     -.003522    .0109816
     cln_GDP2005US |   .0677075   .0068542     9.88   0.000     .0542735    .0811415
 cln_GDP_pc2005USD |  -.0088352   .0100399    -0.88   0.379     -.028513    .0108426
        cGDPgrowth |  -.0003135   .0004833    -0.65   0.517    -.0012607    .0006338
      cTradePctGDP |   .0009701   .0001372     7.07   0.000     .0007013    .0012389
           ckaopen |  -.0014379   .0027607    -0.52   0.602    -.0068487     .003973
      cln_resource |  -.0218793   .0046662    -4.69   0.000    -.0310248   -.0127337
        cln_battle |    .000471   .0009701     0.49   0.627    -.0014302    .0023723
             _cons |   3.402764   .0139871   243.28   0.000      3.37535    3.430178
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |    .132683   .0082421      .1174735    .1498617
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   2.76e-06   .0018262             0           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .1490303   .0016672      .1457982     .152334
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1896.08               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time_lji= 1 if e(sample)==1;
(4,000 missing values generated)

.                 egen id_lji = group(ccode) if e(sample)==1;
(4000 missing values generated)

.                         save `temp', replace;
file C:\Users\mdnieman\AppData\Local\Temp\ST_04000001.tmp saved

.                 matrix k_id_lji = e(k);

.                 matrix L_id_lji = e(ll);

.                 svmat k_id_lji;

.                 svmat L_id_lji;

.                 gen AIC_id_lji = 2*k_id_lji1 - 2*L_id_lji1;
(8,147 missing values generated)

.                 sum AIC_id_lji;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  AIC_id_lji |          1   -3383.378           .  -3383.378  -3383.378

.                                                 predict REccode_yr REyear_yr, reffects level(_all);
(2,039 missing values generated)
(194 missing values generated)

.                 /* Figure M2 */ 
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*cxconst + _b[1970b.year#clji] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                 forvalues year=1971(1)2009  {;
  2.                         replace MEslope_t = (_b[`year'.year#clji_democ])*cxconst + _b[`year'.year#clji] + REyear_yr if year==`year';
  3.                 };
(201 real changes made, 77 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 76 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(197 real changes made, 59 to missing)
(197 real changes made, 57 to missing)
(196 real changes made, 50 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 46 to missing)
(196 real changes made, 45 to missing)
(196 real changes made, 48 to missing)
(197 real changes made, 51 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                 replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                         /* Plot slope over time */
>                 collapse MEslope_t, by(xconst year time_lji);

.                 #delimit;
delimiter now ;
.                         twoway connected MEslope_t year if year<2010 & xconst==1 & time_lji==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lcolor
> (gs14)
>                         || connected MEslope_t year if year<2010 & xconst==2 & time_lji==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                         || connected MEslope_t year if year<2010 & xconst==3 & time_lji==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                         || connected MEslope_t year if year<2010 & xconst==4 & time_lji==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                         || connected MEslope_t year if year<2010 & xconst==5 & time_lji==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                         || connected MEslope_t year if year<2010 & xconst==6 & time_lji==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                         || connected MEslope_t year if year<2010 & xconst==7 & time_lji==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2)
>                                 xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure M2. Time-varying Marginal Effect of Property" "Rights on FDI at Different Levels of Democracy.")
>                                 t2("(LJI, all years)")
>                                 note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy from" 
>                                 "model 2 of Table M1. Darker lines indicate greater levels of Democracy.");

.                                         graph save Figure_M2, replace;
(note: file Figure_M2.gph not found)
(file Figure_M2.gph saved)

. /* Sample: Non-OECD */                                  
>         
>         /* Table R1 Model 1 */                          
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows cPRdemoc cefw2legalrights cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year if OECD==0, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1049.6443  
Iteration 1:   log likelihood =  1049.6443  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,161
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,161
                                                              avg =    1,161.0
                                                              max =      1,161

                                                Wald chi2(10)     =     237.43
Log likelihood =  1049.6443                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          cPRdemoc |    .001869   .0013023     1.44   0.151    -.0006835    .0044214
  cefw2legalrights |  -.0018138   .0033638    -0.54   0.590    -.0084068    .0047792
           cxconst |  -.0028717   .0028771    -1.00   0.318    -.0085106    .0027673
     cln_GDP2005US |    .078915   .0083735     9.42   0.000     .0625032    .0953268
 cln_GDP_pc2005USD |   .0178901   .0115556     1.55   0.122    -.0047585    .0405387
        cGDPgrowth |   .0006837   .0006148     1.11   0.266    -.0005213    .0018887
      cTradePctGDP |   .0007296   .0001648     4.43   0.000     .0004067    .0010526
           ckaopen |   .0035184   .0031701     1.11   0.267    -.0026949    .0097316
      cln_resource |  -.0196373   .0056113    -3.50   0.000    -.0306353   -.0086393
        cln_battle |   .0013944   .0010324     1.35   0.177    -.0006292    .0034179
             _cons |   3.411582   .0158405   215.37   0.000     3.380535    3.442629
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1307804   .0103911      .1119208     .152818
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0135234   .0042085      .0073483    .0248876
-----------------------------+------------------------------------------------
                sd(Residual) |   .0841281   .0018571      .0805658    .0878479
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 922.90                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -2071.289           .  -2071.289  -2071.289

.                                         /* Figure R1 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R1. Marginal Effects of Property Rights on FDI." "(Non-OECD)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R1, replace;
(note: file Figure_R1.gph not found)
(file Figure_R1.gph saved)

.                 /* Table R1 Model 2 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.cPRdemoc#year c.cefw2legalrights#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_b
> attle
>                 || _all: R.ccode || _all: R.year if OECD==0, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1079.9188  
Iteration 1:   log likelihood =  1079.9188  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,161
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,161
                                                              avg =    1,161.0
                                                              max =      1,161

                                                Wald chi2(40)     =     280.01
Log likelihood =  1079.9188                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------------
     ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        year#c.cPRdemoc |
                  1970  |   .0008048   .0051368     0.16   0.876    -.0092632    .0108728
                  1975  |    .002355   .0036432     0.65   0.518    -.0047855    .0094955
                  1980  |   .0023529   .0035525     0.66   0.508    -.0046098    .0093156
                  1985  |   .0027457   .0028626     0.96   0.337     -.002865    .0083564
                  1990  |   .0040893   .0027966     1.46   0.144    -.0013919    .0095705
                  1995  |   .0025446   .0043822     0.58   0.561    -.0060443    .0111336
                  2000  |   .0034944   .0037988     0.92   0.358    -.0039511      .01094
                  2001  |   .0013692   .0032041     0.43   0.669    -.0049108    .0076492
                  2002  |  -.0014175   .0030885    -0.46   0.646    -.0074708    .0046358
                  2003  |  -.0006267   .0030226    -0.21   0.836    -.0065508    .0052974
                  2004  |  -.0020357   .0030133    -0.68   0.499    -.0079416    .0038703
                  2005  |  -.0030922   .0035525    -0.87   0.384     -.010055    .0038705
                  2006  |  -.0031723   .0037682    -0.84   0.400    -.0105578    .0042132
                  2007  |   .0003189   .0036086     0.09   0.930    -.0067538    .0073916
                  2008  |   .0079707   .0038635     2.06   0.039     .0003984     .015543
                  2009  |   .0009347   .0045118     0.21   0.836    -.0079082    .0097777
                        |
year#c.cefw2legalrights |
                  1970  |   .0041311   .0145808     0.28   0.777    -.0244467    .0327089
                  1975  |  -.0004329   .0110201    -0.04   0.969    -.0220319    .0211662
                  1980  |  -.0083032   .0099527    -0.83   0.404    -.0278102    .0112037
                  1985  |  -.0244798   .0080957    -3.02   0.002    -.0403471   -.0086125
                  1990  |  -.0130079   .0073582    -1.77   0.077    -.0274296    .0014139
                  1995  |    -.00669   .0093635    -0.71   0.475    -.0250421    .0116621
                  2000  |   .0058827   .0079899     0.74   0.462    -.0097773    .0215427
                  2001  |   .0076581   .0068833     1.11   0.266    -.0058329    .0211491
                  2002  |  -.0055729   .0065748    -0.85   0.397    -.0184593    .0073135
                  2003  |  -.0009212   .0065559    -0.14   0.888    -.0137706    .0119282
                  2004  |   .0046134    .006896     0.67   0.504    -.0089026    .0181293
                  2005  |   .0050973   .0072556     0.70   0.482    -.0091235    .0193181
                  2006  |   .0240948   .0076317     3.16   0.002      .009137    .0390526
                  2007  |   .0281734   .0074517     3.78   0.000     .0135684    .0427784
                  2008  |   .0212658   .0079439     2.68   0.007      .005696    .0368356
                  2009  |     .02049   .0088936     2.30   0.021     .0030589    .0379211
                        |
                cxconst |  -.0012133   .0028995    -0.42   0.676    -.0068962    .0044696
          cln_GDP2005US |   .0791694   .0085301     9.28   0.000     .0624506    .0958881
      cln_GDP_pc2005USD |   .0053288   .0117459     0.45   0.650    -.0176928    .0283504
             cGDPgrowth |   .0007078   .0006216     1.14   0.255    -.0005105     .001926
           cTradePctGDP |    .000759   .0001645     4.61   0.000     .0004366    .0010814
                ckaopen |   .0026567   .0031939     0.83   0.406    -.0036032    .0089165
           cln_resource |  -.0178764   .0056323    -3.17   0.002    -.0289154   -.0068373
             cln_battle |   .0015434   .0010451     1.48   0.140     -.000505    .0035917
                  _cons |   3.404134   .0163002   208.84   0.000     3.372186    3.436082
-----------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1279147    .009876      .1099515    .1488126
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0214115   .0055254      .0129118    .0355065
-----------------------------+------------------------------------------------
                sd(Residual) |   .0815228   .0017957      .0780782    .0851194
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 960.21                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(6,987 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(6987 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -2071.838           .  -2071.838  -2071.838

.                         predict REccode_yr REyear_yr, reffects level(_all);
(3,802 missing values generated)
(4,981 missing values generated)

.                 /* Figure R2 */ 
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#cPRdemoc])*cxconst + _b[1970b.year#cefw2legalrights] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                 #delimit;
delimiter now ;
.                         forvalues year=1975(5)2000  {;
  2.                                                 replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(201 real changes made, 71 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 72 to missing)
(196 real changes made, 49 to missing)
(197 real changes made, 50 to missing)

.                                         forvalues year=2001/2009  {;
  2.                                         replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                                                 /* Plot slope over time */
>                         collapse MEslope_t, by(xconst year time);

.                                 twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lc
> olor(gs14)
>                                 || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R2. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(Non-OECD)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R2, replace;
(note: file Figure_R2.gph not found)
(file Figure_R2.gph saved)

.                                                                                         /* Table R1 Model 3 */
>         /* lji*/
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows clji_democ clji cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year if OECD==0, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  3678.8647  
Iteration 1:   log likelihood =  3678.8647  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      3,318
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      3,318
                                                              avg =    3,318.0
                                                              max =      3,318

                                                Wald chi2(10)     =     362.04
Log likelihood =  3678.8647                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        clji_democ |   .0137136   .0053172     2.58   0.010     .0032921     .024135
              clji |  -.0712779   .0249188    -2.86   0.004    -.1201178   -.0224379
           cxconst |   .0036063   .0019786     1.82   0.068    -.0002717    .0074842
     cln_GDP2005US |   .0469907   .0049728     9.45   0.000     .0372443    .0567371
 cln_GDP_pc2005USD |   .0114868   .0066812     1.72   0.086     -.001608    .0245817
        cGDPgrowth |  -.0001768   .0002416    -0.73   0.464    -.0006504    .0002968
      cTradePctGDP |    .000452   .0000774     5.84   0.000     .0003003    .0006038
           ckaopen |   .0033109   .0015301     2.16   0.030     .0003119      .00631
      cln_resource |  -.0068243    .002607    -2.62   0.009     -.011934   -.0017145
        cln_battle |   .0015579   .0004995     3.12   0.002      .000579    .0025369
             _cons |   3.412007    .011025   309.48   0.000     3.390399    3.433616
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1079719   .0072062      .0947328    .1230613
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0095896   .0020591      .0062955    .0146073
-----------------------------+------------------------------------------------
                sd(Residual) |   .0736816   .0009288      .0718834    .0755247
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 2209.05               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -7329.729           .  -7329.729  -7329.729

.                                         /* Figure R3 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R3. Marginal Effects of Property Rights on FDI." "(LJI: Non-OECD)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R3, replace;
(note: file Figure_R3.gph not found)
(file Figure_R3.gph saved)

.                 /* Table R1 Model 4 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.clji_democ#year c.clji#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year if OECD==0, mle tech(bfgs);

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  3711.9549  
Iteration 1:   log likelihood =   3712.951  (backed up)
Iteration 2:   log likelihood =  3712.9741  
Iteration 3:   log likelihood =  3713.0313  
Iteration 4:   log likelihood =  3713.0482  
Iteration 5:   log likelihood =  3713.0482  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      3,318
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      3,318
                                                              avg =    3,318.0
                                                              max =      3,318

                                                Wald chi2(88)     =     688.02
Log likelihood =  3713.0482                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
 year#c.clji_democ |
             1970  |   .0205398    .017834     1.15   0.249    -.0144142    .0554938
             1971  |   .0197108   .0179427     1.10   0.272    -.0154563    .0548779
             1972  |   .0128219   .0192391     0.67   0.505     -.024886    .0505298
             1973  |   .0080813   .0189736     0.43   0.670    -.0291061    .0452688
             1974  |   .0039188   .0188997     0.21   0.836     -.033124    .0409616
             1975  |   .0066566   .0183167     0.36   0.716    -.0292435    .0425566
             1976  |  -.0015587   .0168936    -0.09   0.926    -.0346695    .0315521
             1977  |   .0050656    .015493     0.33   0.744    -.0253001    .0354314
             1978  |   .0009082   .0156649     0.06   0.954    -.0297945    .0316108
             1979  |  -.0036884   .0147798    -0.25   0.803    -.0326564    .0252795
             1980  |   -.001156   .0147689    -0.08   0.938    -.0301024    .0277905
             1981  |   .0080118   .0148356     0.54   0.589    -.0210655    .0370891
             1982  |   .0152613   .0147191     1.04   0.300    -.0135876    .0441101
             1983  |   .0150093    .014862     1.01   0.313    -.0141197    .0441384
             1984  |   .0154275   .0150192     1.03   0.304    -.0140095    .0448645
             1985  |    .008046   .0148513     0.54   0.588    -.0210619     .037154
             1986  |   .0099614   .0144221     0.69   0.490    -.0183054    .0382281
             1987  |   .0065754   .0144352     0.46   0.649     -.021717    .0348679
             1988  |   .0095833    .014089     0.68   0.496    -.0180307    .0371972
             1989  |   .0071105   .0145105     0.49   0.624    -.0213295    .0355505
             1990  |    .006667   .0143456     0.46   0.642    -.0214498    .0347838
             1991  |   .0033977   .0144919     0.23   0.815    -.0250059    .0318014
             1992  |   .0044422   .0147341     0.30   0.763    -.0244362    .0333206
             1993  |   .0141126   .0152171     0.93   0.354    -.0157125    .0439376
             1994  |     .01136   .0149664     0.76   0.448    -.0179736    .0406935
             1995  |   .0124244   .0146488     0.85   0.396    -.0162868    .0411355
             1996  |   .0170322    .013275     1.28   0.199    -.0089863    .0430507
             1997  |   .0243129    .013088     1.86   0.063    -.0013391    .0499648
             1998  |   .0205362   .0138592     1.48   0.138    -.0066274    .0476998
             1999  |   .0256635   .0139431     1.84   0.066    -.0016644    .0529914
             2000  |   .0177821   .0141468     1.26   0.209     -.009945    .0455093
             2001  |   .0231169   .0139669     1.66   0.098    -.0042578    .0504916
             2002  |  -.0014247   .0132837    -0.11   0.915    -.0274602    .0246108
             2003  |   .0028998   .0132789     0.22   0.827    -.0231264     .028926
             2004  |   .0072615   .0132607     0.55   0.584     -.018729     .033252
             2005  |   .0174563   .0136071     1.28   0.200    -.0092132    .0441257
             2006  |   .0466798   .0135934     3.43   0.001     .0200373    .0733223
             2007  |   .0632407   .0137073     4.61   0.000      .036375    .0901065
             2008  |    .078523   .0140555     5.59   0.000     .0509746    .1060713
             2009  |   .0668006   .0151271     4.42   0.000      .037152    .0964493
                   |
       year#c.clji |
             1970  |  -.0862592   .0542296    -1.59   0.112    -.1925472    .0200287
             1971  |  -.0748586   .0548418    -1.36   0.172    -.1823465    .0326294
             1972  |    -.10929   .0587462    -1.86   0.063    -.2244305    .0058505
             1973  |  -.1069257   .0574706    -1.86   0.063    -.2195661    .0057147
             1974  |  -.0570333    .058325    -0.98   0.328    -.1713482    .0572816
             1975  |  -.1121436   .0571401    -1.96   0.050    -.2241361   -.0001512
             1976  |  -.1133145   .0537915    -2.11   0.035    -.2187439   -.0078851
             1977  |  -.1075243   .0500541    -2.15   0.032    -.2056285   -.0094201
             1978  |  -.1140007   .0491603    -2.32   0.020    -.2103532   -.0176482
             1979  |  -.1151785   .0463944    -2.48   0.013    -.2061098   -.0242472
             1980  |  -.0992124   .0467612    -2.12   0.034    -.1908627   -.0075621
             1981  |  -.1131167   .0473458    -2.39   0.017    -.2059129   -.0203206
             1982  |  -.1176126   .0468359    -2.51   0.012    -.2094092    -.025816
             1983  |  -.1117586   .0476473    -2.35   0.019    -.2051456   -.0183716
             1984  |   -.085521   .0476485    -1.79   0.073    -.1789104    .0078683
             1985  |  -.0920934   .0476979    -1.93   0.054    -.1855795    .0013927
             1986  |  -.1051345   .0462145    -2.27   0.023    -.1957132   -.0145558
             1987  |  -.1060822   .0459318    -2.31   0.021    -.1961069   -.0160575
             1988  |  -.1096968   .0453666    -2.42   0.016    -.1986137   -.0207798
             1989  |  -.1178577   .0462837    -2.55   0.011    -.2085722   -.0271433
             1990  |  -.1187865   .0456497    -2.60   0.009    -.2082583   -.0293147
             1991  |  -.1098912   .0446199    -2.46   0.014    -.1973446   -.0224377
             1992  |  -.1289173   .0447545    -2.88   0.004    -.2166345      -.0412
             1993  |  -.1564871   .0437307    -3.58   0.000    -.2421977   -.0707766
             1994  |   -.161558    .042903    -3.77   0.000    -.2456463   -.0774698
             1995  |  -.1155167   .0418376    -2.76   0.006     -.197517   -.0335165
             1996  |   -.112265   .0391766    -2.87   0.004    -.1890497   -.0354803
             1997  |  -.1023526   .0395549    -2.59   0.010    -.1798788   -.0248265
             1998  |  -.1007253   .0399751    -2.52   0.012     -.179075   -.0223756
             1999  |  -.0751026   .0402853    -1.86   0.062    -.1540603     .003855
             2000  |  -.0505278   .0399323    -1.27   0.206    -.1287936    .0277381
             2001  |   -.050026   .0403403    -1.24   0.215    -.1290915    .0290396
             2002  |  -.1155381   .0391148    -2.95   0.003    -.1922017   -.0388744
             2003  |  -.1042394   .0393723    -2.65   0.008    -.1814077   -.0270711
             2004  |  -.0968003   .0395762    -2.45   0.014    -.1743682   -.0192324
             2005  |  -.1275818   .0392198    -3.25   0.001    -.2044513   -.0507123
             2006  |  -.1160673    .038651    -3.00   0.003    -.1918219   -.0403127
             2007  |  -.1119717   .0387433    -2.89   0.004    -.1879071   -.0360362
             2008  |  -.0666765   .0392597    -1.70   0.089    -.1436241    .0102711
             2009  |  -.1199272   .0400363    -3.00   0.003    -.1983968   -.0414575
                   |
           cxconst |   .0054932   .0019773     2.78   0.005     .0016178    .0093686
     cln_GDP2005US |   .0457363   .0051392     8.90   0.000     .0356636    .0558089
 cln_GDP_pc2005USD |   .0120656    .006895     1.75   0.080    -.0014483    .0255795
        cGDPgrowth |   .0000163   .0002444     0.07   0.947    -.0004628    .0004954
      cTradePctGDP |   .0004961   .0000767     6.47   0.000     .0003457    .0006464
           ckaopen |   .0033672   .0015387     2.19   0.029     .0003514    .0063831
      cln_resource |   -.006341   .0025957    -2.44   0.015    -.0114284   -.0012536
        cln_battle |   .0014085   .0005017     2.81   0.005     .0004252    .0023919
             _cons |   3.408569   .0108816   313.24   0.000     3.387241    3.429896
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1075388   .0071819      .0943448    .1225779
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   1.16e-06   .0013192             0           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .0732892   .0009191      .0715098    .0751129
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 2142.57               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(4,830 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(4830 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -7242.096           .  -7242.096  -7242.096

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,900 missing values generated)
(194 missing values generated)

.                 /* Figure R4 */ 
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*cxconst + _b[1970b.year#clji] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                                         forvalues year=1971(1)2009  {;
  2.                                                 replace MEslope_t = (_b[`year'.year#clji_democ])*cxconst + _b[`year'.year#clji] + REyear_yr if year==`year';
  3.                         };
(201 real changes made, 77 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 76 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(197 real changes made, 59 to missing)
(197 real changes made, 57 to missing)
(196 real changes made, 50 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 46 to missing)
(196 real changes made, 45 to missing)
(196 real changes made, 48 to missing)
(197 real changes made, 51 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                                 /* Plot slope over time */
>                         collapse MEslope_t, by(xconst year time);

.                         #delimit;
delimiter now ;
.                                 twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lc
> olor(gs14)
>                                 || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R4. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(LJI: Non-OECD)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R4, replace;
(note: file Figure_R4.gph not found)
(file Figure_R4.gph saved)

.                                                                                 /* Sample: All Countries with BITs */
>         
>         /* Table R2 Model 1 */
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows cPRdemoc cefw2legalrights cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle lnbit_count
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  159.20677  
Iteration 1:   log likelihood =  159.20677  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =        505
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =        505
                                                              avg =      505.0
                                                              max =        505

                                                Wald chi2(11)     =     187.54
Log likelihood =  159.20677                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          cPRdemoc |   .0128085   .0024183     5.30   0.000     .0080688    .0175482
  cefw2legalrights |   .0084927   .0077061     1.10   0.270    -.0066111    .0235964
           cxconst |   .0001644   .0056202     0.03   0.977    -.0108509    .0111797
     cln_GDP2005US |   .0639051   .0096534     6.62   0.000     .0449848    .0828253
 cln_GDP_pc2005USD |  -.0231396   .0139626    -1.66   0.097    -.0505057    .0042266
        cGDPgrowth |   .0008109   .0017545     0.46   0.644     -.002628    .0042497
      cTradePctGDP |   .0004483    .000364     1.23   0.218    -.0002652    .0011617
           ckaopen |   .0157561   .0078239     2.01   0.044     .0004216    .0310907
      cln_resource |  -.0112746   .0097723    -1.15   0.249     -.030428    .0078788
        cln_battle |  -.0041318   .0027902    -1.48   0.139    -.0096005    .0013369
       lnbit_count |   .0027505   .0036586     0.75   0.452    -.0044203    .0099213
             _cons |   3.366611   .0279799   120.32   0.000     3.311771     3.42145
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .0934851   .0103098      .0753129    .1160421
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0500827   .0173955      .0253533    .0989328
-----------------------------+------------------------------------------------
                sd(Residual) |   .1575198   .0055885      .1469387    .1688629
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 66.70                 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -288.4135           .  -288.4135  -288.4135

.                                         /* Figure R5 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b08 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                 /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R5. Marginal Effects of Property Rights on FDI." "(BITs, all countries)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R5, replace;
(note: file Figure_R5.gph not found)
(file Figure_R5.gph saved)

.                 /* Table R2 Model 2 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.cPRdemoc#year c.cefw2legalrights#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_b
> attle lnbit_count
>                 || _all: R.ccode || _all: R.year , mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  251.13467  
Iteration 1:   log likelihood =  251.13636  
Iteration 2:   log likelihood =  251.13636  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =        505
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =        505
                                                              avg =      505.0
                                                              max =        505

                                                Wald chi2(23)     =     471.76
Log likelihood =  251.13636                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------------
     ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        year#c.cPRdemoc |
                  1970  |   .0007641   .0053223     0.14   0.886    -.0096676    .0111957
                  1975  |  -.0028376   .0050304    -0.56   0.573    -.0126969    .0070218
                  1980  |   .0020811   .0041279     0.50   0.614    -.0060095    .0101717
                  1985  |   .0004483   .0037983     0.12   0.906    -.0069962    .0078928
                  1990  |   .0065267   .0038172     1.71   0.087    -.0009548    .0140082
                  1995  |    .009044   .0052999     1.71   0.088    -.0013436    .0194317
                  2000  |   .0376848   .0046467     8.11   0.000     .0285775    .0467921
                        |
year#c.cefw2legalrights |
                  1970  |  -.0131703   .0145177    -0.91   0.364    -.0416245    .0152838
                  1975  |  -.0232622   .0138846    -1.68   0.094    -.0504756    .0039512
                  1980  |  -.0116559   .0104879    -1.11   0.266    -.0322118    .0089001
                  1985  |  -.0214594   .0097683    -2.20   0.028     -.040605   -.0023139
                  1990  |   .0002365   .0098452     0.02   0.981    -.0190597    .0195327
                  1995  |  -.0025945    .013668    -0.19   0.849    -.0293832    .0241942
                  2000  |   .0431292   .0118638     3.64   0.000     .0198766    .0663818
                        |
                cxconst |    .002766   .0048533     0.57   0.569    -.0067463    .0122784
          cln_GDP2005US |   .0669264   .0093635     7.15   0.000     .0485744    .0852785
      cln_GDP_pc2005USD |  -.0334389   .0132587    -2.52   0.012    -.0594255   -.0074523
             cGDPgrowth |   .0004924   .0014662     0.34   0.737    -.0023813    .0033661
           cTradePctGDP |   .0005988   .0003241     1.85   0.065    -.0000363     .001234
                ckaopen |   .0132826   .0067484     1.97   0.049      .000056    .0265092
           cln_resource |  -.0096583   .0091997    -1.05   0.294    -.0276894    .0083728
             cln_battle |  -.0014498   .0023666    -0.61   0.540    -.0060883    .0031887
            lnbit_count |    .005577   .0029635     1.88   0.060    -.0002312    .0113853
                  _cons |   3.376621   .0198497   170.11   0.000     3.337716    3.415526
-----------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1068654   .0097511       .089365    .1277929
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0195691   .0159662      .0039544    .0968401
-----------------------------+------------------------------------------------
                sd(Residual) |   .1255238   .0046077        .11681    .1348875
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 120.02                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(7,643 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(7643 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -448.2727           .  -448.2727  -448.2727

.                         predict REccode_yr REyear_yr, reffects level(_all);
(3,597 missing values generated)
(6,750 missing values generated)

.                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#cPRdemoc])*cxconst + _b[1970b.year#cefw2legalrights] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                         forvalues year=1975(5)2000  {;
  2.                         replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                 };
(201 real changes made, 71 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 72 to missing)
(196 real changes made, 49 to missing)
(197 real changes made, 50 to missing)

.                         /* Figure R6 */ 
>         /* Plot slope over time */
>                 collapse MEslope_t, by(xconst year time);

.                         twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lcolor(gs1
> 4)
>                         || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                         || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                         || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                         || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                         || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                         || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                 xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R6. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(BITs, all countries)")
>                                 note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                 "lines indicate greater levels of Democracy.");

.                                         graph save Figure_R6, replace;
(note: file Figure_R6.gph not found)
(file Figure_R6.gph saved)

.                                                 /* Table R2 Model 3 */                          
>         /* lji*/
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows clji_democ clji cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle lnbit_count
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  2029.1762  
Iteration 1:   log likelihood =  2029.1762  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      2,898
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      2,898
                                                              avg =    2,898.0
                                                              max =      2,898

                                                Wald chi2(11)     =     257.14
Log likelihood =  2029.1762                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        clji_democ |   .0484404   .0084606     5.73   0.000     .0318578    .0650229
              clji |  -.0133782   .0393279    -0.34   0.734    -.0904596    .0637031
           cxconst |  -.0010895   .0032864    -0.33   0.740    -.0075307    .0053518
     cln_GDP2005US |   .0330622   .0057708     5.73   0.000     .0217517    .0443728
 cln_GDP_pc2005USD |    .012103   .0087211     1.39   0.165      -.00499     .029196
        cGDPgrowth |  -.0001124   .0004068    -0.28   0.782    -.0009098     .000685
      cTradePctGDP |   .0003397   .0001391     2.44   0.015      .000067    .0006123
           ckaopen |   .0086336    .002747     3.14   0.002     .0032497    .0140176
      cln_resource |  -.0167778   .0045276    -3.71   0.000    -.0256519   -.0079038
        cln_battle |  -.0025783   .0008962    -2.88   0.004    -.0043347   -.0008218
       lnbit_count |   .0034305   .0011392     3.01   0.003     .0011977    .0056632
             _cons |   3.386859   .0133943   252.86   0.000     3.360606    3.413111
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .0983063   .0068353      .0857821     .112659
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0346729    .005512      .0253907    .0473486
-----------------------------+------------------------------------------------
                sd(Residual) |   .1112219    .001516      .1082899    .1142333
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1353.02               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -4028.352           .  -4028.352  -4028.352

.                         /* Figure R7 */         
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                         /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b08 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R7. Marginal Effects of Property Rights on FDI." "(LJI: BITs, all countries)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R7, replace;
(note: file Figure_R7.gph not found)
(file Figure_R7.gph saved)

.                 /* Table R2 Model 4 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.clji_democ#year c.clji#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle lnbi
> t_count
>                 || _all: R.ccode || _all: R.year , mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  2340.0754  
Iteration 1:   log likelihood =  2340.8687  
Iteration 2:   log likelihood =  2340.8898  
Iteration 3:   log likelihood =  2340.8898  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      2,898
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      2,898
                                                              avg =    2,898.0
                                                              max =      2,898

                                                Wald chi2(71)     =    1431.57
Log likelihood =  2340.8898                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
 year#c.clji_democ |
             1970  |  -.0057088     .01778    -0.32   0.748     -.040557    .0291394
             1971  |  -.0321413   .0173476    -1.85   0.064    -.0661421    .0018594
             1972  |  -.0346737   .0170268    -2.04   0.042    -.0680457   -.0013017
             1973  |  -.0312612   .0168809    -1.85   0.064    -.0643471    .0018247
             1974  |  -.0244485   .0166007    -1.47   0.141    -.0569853    .0080883
             1975  |  -.0218322   .0161169    -1.35   0.176    -.0534207    .0097563
             1976  |  -.0293341   .0154536    -1.90   0.058    -.0596226    .0009543
             1977  |  -.0158541   .0145793    -1.09   0.277    -.0444291    .0127209
             1978  |  -.0158326   .0148999    -1.06   0.288    -.0450359    .0133707
             1979  |  -.0123065   .0146613    -0.84   0.401    -.0410421    .0164291
             1980  |   -.004203    .014624    -0.29   0.774    -.0328655    .0244595
             1981  |  -.0028634   .0144165    -0.20   0.843    -.0311193    .0253925
             1982  |  -.0108129    .014377    -0.75   0.452    -.0389914    .0173655
             1983  |  -.0105512   .0144646    -0.73   0.466    -.0389013    .0177989
             1984  |  -.0110765   .0145455    -0.76   0.446    -.0395852    .0174322
             1985  |  -.0126641    .014383    -0.88   0.379    -.0408543    .0155261
             1986  |  -.0023039   .0143156    -0.16   0.872    -.0303621    .0257542
             1987  |   .0140152   .0143967     0.97   0.330    -.0142018    .0422322
             1988  |   .0196931   .0143332     1.37   0.169    -.0083994    .0477856
             1989  |   .0271895    .014689     1.85   0.064    -.0016004    .0559794
             1990  |   .0281593   .0149298     1.89   0.059    -.0011026    .0574213
             1991  |   -.001981   .0160443    -0.12   0.902    -.0334272    .0294651
             1992  |   .0016546   .0164777     0.10   0.920     -.030641    .0339503
             1993  |   .0253928   .0172953     1.47   0.142    -.0085055     .059291
             1994  |   .0267583   .0174712     1.53   0.126    -.0074846    .0610011
             1995  |    .032277   .0175313     1.84   0.066    -.0020837    .0666376
             1996  |   .0378427   .0162855     2.32   0.020     .0059237    .0697618
             1997  |   .0528988   .0158065     3.35   0.001     .0219186    .0838791
             1998  |   .0984362   .0168996     5.82   0.000     .0653136    .1315587
             1999  |   .1298015   .0168282     7.71   0.000     .0968189    .1627841
             2000  |   .1802529   .0168235    10.71   0.000     .1472795    .2132264
                   |
       year#c.clji |
             1970  |  -.0838349   .0569118    -1.47   0.141    -.1953801    .0277103
             1971  |  -.1558499   .0560487    -2.78   0.005    -.2657035   -.0459964
             1972  |  -.1759662   .0554283    -3.17   0.002    -.2846036   -.0673287
             1973  |  -.1606777   .0548954    -2.93   0.003    -.2682707   -.0530848
             1974  |  -.1078628   .0552618    -1.95   0.051     -.216174    .0004484
             1975  |  -.1746483   .0539912    -3.23   0.001    -.2804692   -.0688275
             1976  |  -.1694694   .0529028    -3.20   0.001     -.273157   -.0657819
             1977  |  -.1259027   .0509135    -2.47   0.013    -.2256913   -.0261141
             1978  |  -.1255793   .0507234    -2.48   0.013    -.2249954   -.0261632
             1979  |  -.0998164   .0498891    -2.00   0.045    -.1975972   -.0020355
             1980  |  -.0769343   .0501268    -1.53   0.125     -.175181    .0213124
             1981  |  -.1109885   .0498037    -2.23   0.026    -.2086019    -.013375
             1982  |  -.1459159   .0497228    -2.93   0.003    -.2433708   -.0484609
             1983  |   -.137077   .0502353    -2.73   0.006    -.2355363   -.0386176
             1984  |  -.1167975   .0503496    -2.32   0.020    -.2154808   -.0181141
             1985  |  -.0996822    .050108    -1.99   0.047     -.197892   -.0014723
             1986  |   -.060414   .0497962    -1.21   0.225    -.1580128    .0371849
             1987  |  -.0070537   .0499611    -0.14   0.888    -.1049757    .0908683
             1988  |   .0041097   .0501554     0.08   0.935    -.0941931    .1024125
             1989  |   .0100629    .051209     0.20   0.844     -.090305    .1104307
             1990  |   .0160027    .051591     0.31   0.756    -.0851139    .1171192
             1991  |  -.0455915   .0531041    -0.86   0.391    -.1496737    .0584907
             1992  |  -.0642084   .0541461    -1.19   0.236    -.1703327     .041916
             1993  |   -.062221   .0546871    -1.14   0.255    -.1694057    .0449637
             1994  |  -.0638966   .0547178    -1.17   0.243    -.1711414    .0433483
             1995  |   .0040959   .0544729     0.08   0.940     -.102669    .1108608
             1996  |  -.0018573   .0517392    -0.04   0.971    -.1032643    .0995498
             1997  |   .0341361   .0514881     0.66   0.507    -.0667786    .1350509
             1998  |   .1283081   .0527867     2.43   0.015     .0248481    .2317681
             1999  |    .212959   .0529266     4.02   0.000     .1092248    .3166933
             2000  |   .3409079   .0519477     6.56   0.000     .2390922    .4427236
                   |
           cxconst |   .0031311   .0030067     1.04   0.298    -.0027619    .0090241
     cln_GDP2005US |   .0418503   .0056239     7.44   0.000     .0308278    .0528729
 cln_GDP_pc2005USD |  -.0058702   .0085152    -0.69   0.491    -.0225597    .0108192
        cGDPgrowth |  -.0001514    .000374    -0.40   0.686    -.0008844    .0005816
      cTradePctGDP |    .000422   .0001255     3.36   0.001     .0001761    .0006679
           ckaopen |   .0009771   .0025239     0.39   0.699    -.0039696    .0059238
      cln_resource |  -.0175095   .0041881    -4.18   0.000     -.025718   -.0093009
        cln_battle |  -.0006783   .0008013    -0.85   0.397    -.0022488    .0008923
       lnbit_count |   .0029767    .001026     2.90   0.004     .0009658    .0049877
             _cons |   3.403076   .0114959   296.03   0.000     3.380545    3.425608
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1004526   .0064696        .08854    .1139679
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   7.73e-07   .0005378             0           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .1005062   .0013542      .0978868    .1031957
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1648.98               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(5,250 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(5250 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1    -4531.78           .   -4531.78   -4531.78

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,326 missing values generated)
(1,963 missing values generated)

.                 /* Figure R8 */         
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*cxconst + _b[1970b.year#clji] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                         forvalues year=1971(1)2000  {;
  2.                                 replace MEslope_t = (_b[`year'.year#clji_democ])*cxconst + _b[`year'.year#clji] + REyear_yr if year==`year';
  3.                 };
(201 real changes made, 77 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 76 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(197 real changes made, 59 to missing)
(197 real changes made, 57 to missing)
(196 real changes made, 50 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 46 to missing)
(196 real changes made, 45 to missing)
(196 real changes made, 48 to missing)
(197 real changes made, 51 to missing)
(197 real changes made, 50 to missing)

.                                                 /* Plot slope over time */
>                 collapse MEslope_t, by(xconst year time);

.                         twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lcolor(gs1
> 4)
>                         || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                         || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                         || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                         || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                         || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                         || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                 xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R8. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(LJI: BITs, all countries)")
>                                 note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                 "lines indicate greater levels of Democracy.");

.                                         graph save Figure_R8, replace;
(note: file Figure_R8.gph not found)
(file Figure_R8.gph saved)

.                                                                 /* Sample: Non-OECD with BITs */
> 
>         /* Table R3 Model 1 */
>         /* Fixed model */ 
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows cPRdemoc cefw2legalrights cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle lnbit_count
>                 || _all: R.ccode || _all: R.year if OECD==0, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  442.22192  
Iteration 1:   log likelihood =  442.23748  
Iteration 2:   log likelihood =  442.23751  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =        379
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =        379
                                                              avg =      379.0
                                                              max =        379

                                                Wald chi2(11)     =      80.25
Log likelihood =  442.23751                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          cPRdemoc |   .0027665   .0013426     2.06   0.039      .000135    .0053979
  cefw2legalrights |   .0021459   .0036049     0.60   0.552    -.0049197    .0092114
           cxconst |   .0008307   .0027726     0.30   0.764    -.0046034    .0062649
     cln_GDP2005US |    .033129   .0047852     6.92   0.000     .0237502    .0425077
 cln_GDP_pc2005USD |  -.0104858   .0066964    -1.57   0.117    -.0236105    .0026389
        cGDPgrowth |   .0007071   .0007825     0.90   0.366    -.0008265    .0022407
      cTradePctGDP |   .0002739   .0001686     1.62   0.104    -.0000565    .0006044
           ckaopen |  -.0009024   .0038997    -0.23   0.817    -.0085457     .006741
      cln_resource |  -.0077485   .0047959    -1.62   0.106    -.0171483    .0016513
        cln_battle |  -.0007159   .0012006    -0.60   0.551    -.0030691    .0016373
       lnbit_count |   .0024666   .0017281     1.43   0.153    -.0009205    .0058536
             _cons |   3.391468   .0096468   351.56   0.000      3.37256    3.410375
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .0423143   .0055927      .0326575    .0548266
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |    .005718   .0083356      .0003284    .0995685
-----------------------------+------------------------------------------------
                sd(Residual) |   .0671883   .0028481      .0618317     .073009
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 33.45                 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1    -854.475           .   -854.475   -854.475

.                                         /* Figure R9 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b08 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R9. Marginal Effects of Property Rights on FDI." "(BITs, Non-OECD)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R9, replace;
(note: file Figure_R9.gph not found)
(file Figure_R9.gph saved)

.                 /* Table R3 Model 2 */
>         /* Time-varying model */ 
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.cPRdemoc#year c.cefw2legalrights#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_b
> attle lnbit_count
>                 || _all: R.ccode || _all: R.year if OECD==0, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  445.74236  
Iteration 1:   log likelihood =  445.75012  
Iteration 2:   log likelihood =  445.75013  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =        379
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =        379
                                                              avg =      379.0
                                                              max =        379

                                                Wald chi2(23)     =      86.45
Log likelihood =  445.75013                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------------
     ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        year#c.cPRdemoc |
                  1970  |   .0030111   .0039489     0.76   0.446    -.0047285    .0107507
                  1975  |   .0010363   .0030423     0.34   0.733    -.0049266    .0069992
                  1980  |   .0015154    .003047     0.50   0.619    -.0044566    .0074874
                  1985  |   .0012651   .0024442     0.52   0.605    -.0035255    .0060557
                  1990  |   .0018304   .0024007     0.76   0.446    -.0028748    .0065357
                  1995  |   .0058118   .0036149     1.61   0.108    -.0012733    .0128969
                  2000  |   .0068946   .0031572     2.18   0.029     .0007065    .0130826
                        |
year#c.cefw2legalrights |
                  1970  |   .0157167   .0110716     1.42   0.156    -.0059832    .0374166
                  1975  |   .0069416   .0080111     0.87   0.386    -.0087599     .022643
                  1980  |   .0001071   .0079864     0.01   0.989     -.015546    .0157603
                  1985  |  -.0044299    .006463    -0.69   0.493    -.0170971    .0082373
                  1990  |  -.0014947   .0061483    -0.24   0.808    -.0135452    .0105558
                  1995  |  -.0020774   .0079412    -0.26   0.794     -.017642    .0134871
                  2000  |   .0027442   .0066943     0.41   0.682    -.0103763    .0158648
                        |
                cxconst |  -.0000793   .0028076    -0.03   0.977    -.0055822    .0054235
          cln_GDP2005US |   .0338126   .0048063     7.04   0.000     .0243924    .0432328
      cln_GDP_pc2005USD |  -.0109613   .0069048    -1.59   0.112    -.0244945     .002572
             cGDPgrowth |   .0007847   .0007994     0.98   0.326    -.0007821    .0023514
           cTradePctGDP |   .0002807   .0001696     1.66   0.098    -.0000517    .0006132
                ckaopen |  -.0004411   .0039307    -0.11   0.911    -.0081451    .0072628
           cln_resource |  -.0075958   .0048654    -1.56   0.118    -.0171317    .0019401
             cln_battle |  -.0012172   .0012898    -0.94   0.345    -.0037452    .0013109
            lnbit_count |   .0025669   .0017516     1.47   0.143    -.0008661        .006
                  _cons |   3.389885   .0098792   343.13   0.000     3.370523    3.409248
-----------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .0425293   .0055698      .0329013    .0549749
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0071154   .0081309      .0007577    .0668172
-----------------------------+------------------------------------------------
                sd(Residual) |   .0663196   .0028506      .0609614    .0721489
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 33.45                 Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(7,769 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(7769 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -837.5002           .  -837.5002  -837.5002

.                         predict REccode_yr REyear_yr, reffects level(_all);
(4,417 missing values generated)
(6,750 missing values generated)

.                 /* Figure R10 */        
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#cPRdemoc])*cxconst + _b[1970b.year#cefw2legalrights] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                         forvalues year=1975(5)2000  {;
  2.                         replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                 };
(201 real changes made, 71 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 72 to missing)
(196 real changes made, 49 to missing)
(197 real changes made, 50 to missing)

.                                                 /* Plot slope over time */
>                 collapse MEslope_t, by(xconst year time);

.                         twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lcolor(gs1
> 4)
>                         || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                         || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                         || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                         || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                         || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                         || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                 xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R10. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(BITs, Non-OECD)")
>                                 note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                 "lines indicate greater levels of Democracy.");

.                                         graph save Figure_R10, replace;
(note: file Figure_R10.gph not found)
(file Figure_R10.gph saved)

.                 /* Table R3 Model 3 */ 
>         /* lji*/
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows clji_democ clji cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle lnbit_count
>                 || _all: R.ccode || _all: R.year if OECD==0, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  3359.1593  
Iteration 1:   log likelihood =  3359.2213  
Iteration 2:   log likelihood =  3359.2214  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      2,319
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      2,319
                                                              avg =    2,319.0
                                                              max =      2,319

                                                Wald chi2(11)     =     222.62
Log likelihood =  3359.2214                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        clji_democ |   .0103981   .0044925     2.31   0.021     .0015931    .0192032
              clji |  -.0569918   .0204898    -2.78   0.005    -.0971511   -.0168324
           cxconst |   .0037394   .0016437     2.27   0.023     .0005178     .006961
     cln_GDP2005US |   .0278485   .0030286     9.20   0.000     .0219126    .0337844
 cln_GDP_pc2005USD |    .000026   .0045947     0.01   0.995    -.0089795    .0090315
        cGDPgrowth |   -.000413   .0001948    -2.12   0.034    -.0007949   -.0000312
      cTradePctGDP |    .000249   .0000683     3.65   0.000     .0001151    .0003828
           ckaopen |   .0011968   .0014536     0.82   0.410    -.0016523    .0040459
      cln_resource |   -.008418   .0022991    -3.66   0.000    -.0129241   -.0039118
        cln_battle |   -.000038   .0004246    -0.09   0.929    -.0008703    .0007942
       lnbit_count |   .0028795   .0005977     4.82   0.000      .001708    .0040511
             _cons |   3.400655   .0064288   528.97   0.000     3.388055    3.413256
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .0507432   .0037361      .0439244    .0586206
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0033537   .0024422      .0008047    .0139761
-----------------------------+------------------------------------------------
                sd(Residual) |   .0528102   .0008063      .0512534    .0544144
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 932.02                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -6688.443           .  -6688.443  -6688.443

.                                         /* Figure R11 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b08 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                                 /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R11. Marginal Effects of Property Rights on FDI." "(LJI: BITs, Non-OECD)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R11, replace;
(note: file Figure_R11.gph not found)
(file Figure_R11.gph saved)

.                 /* Table R3 Model 4 */
>         /* Time-varying model */ 
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.clji_democ#year c.clji#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle lnbi
> t_count
>                 || _all: R.ccode || _all: R.year if OECD==0, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  3378.0322  
Iteration 1:   log likelihood =  3378.7121  
Iteration 2:   log likelihood =  3379.0122  
Iteration 3:   log likelihood =  3379.0179  
Iteration 4:   log likelihood =  3379.0179  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      2,319
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      2,319
                                                              avg =    2,319.0
                                                              max =      2,319

                                                Wald chi2(71)     =     299.06
Log likelihood =  3379.0179                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
 year#c.clji_democ |
             1970  |   .0215453   .0127725     1.69   0.092    -.0034883    .0465789
             1971  |   .0229301   .0128552     1.78   0.074    -.0022657    .0481259
             1972  |   .0135665    .013997     0.97   0.332    -.0138671        .041
             1973  |   .0088411   .0137852     0.64   0.521    -.0181773    .0358595
             1974  |   .0091076   .0137497     0.66   0.508    -.0178413    .0360565
             1975  |    .015233    .013323     1.14   0.253    -.0108795    .0413456
             1976  |   .0039021   .0123287     0.32   0.752    -.0202616    .0280659
             1977  |   .0057252   .0113397     0.50   0.614    -.0165001    .0279506
             1978  |   .0057448   .0114713     0.50   0.617    -.0167384    .0282281
             1979  |  -.0004152   .0108255    -0.04   0.969    -.0216328    .0208024
             1980  |   .0028181    .010831     0.26   0.795    -.0184103    .0240466
             1981  |   .0122861   .0108978     1.13   0.260    -.0090731    .0336454
             1982  |   .0145028   .0108036     1.34   0.179    -.0066719    .0356774
             1983  |   .0120852   .0109147     1.11   0.268    -.0093072    .0334776
             1984  |   .0133864   .0110373     1.21   0.225    -.0082462    .0350191
             1985  |   .0054576   .0109194     0.50   0.617     -.015944    .0268591
             1986  |    .005157   .0106349     0.48   0.628     -.015687     .026001
             1987  |   .0042084   .0106348     0.40   0.692    -.0166354    .0250523
             1988  |   .0064622    .010394     0.62   0.534    -.0139098    .0268341
             1989  |   .0075604   .0107018     0.71   0.480    -.0134147    .0285356
             1990  |   .0070027   .0106109     0.66   0.509    -.0137943    .0277996
             1991  |   .0040133   .0107151     0.37   0.708    -.0169878    .0250145
             1992  |   .0047902   .0108987     0.44   0.660    -.0165709    .0261512
             1993  |    .016848   .0111888     1.51   0.132    -.0050817    .0387777
             1994  |   .0163938   .0110152     1.49   0.137    -.0051955    .0379832
             1995  |   .0169924   .0109006     1.56   0.119    -.0043723    .0383571
             1996  |   .0189555   .0099955     1.90   0.058    -.0006353    .0385463
             1997  |    .026455   .0098609     2.68   0.007      .007128    .0457821
             1998  |   .0231023   .0104892     2.20   0.028     .0025438    .0436607
             1999  |   .0283593    .010508     2.70   0.007     .0077641    .0489545
             2000  |   .0275613   .0106198     2.60   0.009     .0067469    .0483756
                   |
       year#c.clji |
             1970  |  -.0355648    .039585    -0.90   0.369      -.11315    .0420203
             1971  |  -.0253961   .0400646    -0.63   0.526    -.1039213     .053129
             1972  |  -.0630973    .043489    -1.45   0.147    -.1483342    .0221397
             1973  |  -.0587353   .0425101    -1.38   0.167    -.1420536     .024583
             1974  |   -.014394   .0431797    -0.33   0.739    -.0990246    .0702366
             1975  |  -.0647876   .0422902    -1.53   0.126    -.1476749    .0180997
             1976  |  -.0731964   .0400173    -1.83   0.067     -.151629    .0052362
             1977  |  -.0723185   .0374617    -1.93   0.054    -.1457421    .0011052
             1978  |  -.0740718   .0367699    -2.01   0.044    -.1461396    -.002004
             1979  |  -.0759217   .0348383    -2.18   0.029    -.1442036   -.0076399
             1980  |  -.0645356   .0351347    -1.84   0.066    -.1333983    .0043271
             1981  |  -.0773467   .0355969    -2.17   0.030    -.1471154    -.007578
             1982  |  -.0839257   .0352637    -2.38   0.017    -.1530413     -.01481
             1983  |  -.0805851   .0358644    -2.25   0.025     -.150878   -.0102922
             1984  |  -.0604973    .035946    -1.68   0.092    -.1309501    .0099555
             1985  |  -.0685433   .0359731    -1.91   0.057    -.1390494    .0019627
             1986  |  -.0667561   .0347793    -1.92   0.055    -.1349222      .00141
             1987  |  -.0630205   .0345752    -1.82   0.068    -.1307866    .0047457
             1988  |  -.0696448   .0342463    -2.03   0.042    -.1367663   -.0025233
             1989  |  -.0780118   .0349503    -2.23   0.026     -.146513   -.0095105
             1990  |  -.0769466   .0345207    -2.23   0.026    -.1446059   -.0092872
             1991  |  -.0732579   .0336902    -2.17   0.030    -.1392895   -.0072264
             1992  |  -.0961576   .0338996    -2.84   0.005    -.1625997   -.0297156
             1993  |  -.1199324   .0331217    -3.62   0.000    -.1848498   -.0550151
             1994  |  -.1278687    .032482    -3.94   0.000    -.1915322   -.0642052
             1995  |  -.0818123    .031988    -2.56   0.011    -.1445076    -.019117
             1996  |  -.0878404   .0301261    -2.92   0.004    -.1468864   -.0287944
             1997  |  -.0771414   .0305551    -2.52   0.012    -.1370284   -.0172545
             1998  |  -.0792787   .0306868    -2.58   0.010    -.1394237   -.0191337
             1999  |  -.0517785   .0309796    -1.67   0.095    -.1124974    .0089404
             2000  |  -.0240763    .030489    -0.79   0.430    -.0838337     .035681
                   |
           cxconst |   .0044718   .0016637     2.69   0.007      .001211    .0077327
     cln_GDP2005US |   .0270087   .0030784     8.77   0.000     .0209752    .0330423
 cln_GDP_pc2005USD |   .0011574   .0046945     0.25   0.805    -.0080437    .0103585
        cGDPgrowth |  -.0003508   .0001994    -1.76   0.079    -.0007416    .0000401
      cTradePctGDP |   .0002576   .0000685     3.76   0.000     .0001234    .0003918
           ckaopen |   .0008566   .0014664     0.58   0.559    -.0020174    .0037307
      cln_resource |  -.0081772    .002322    -3.52   0.000    -.0127282   -.0036262
        cln_battle |  -.0002079   .0004369    -0.48   0.634    -.0010641    .0006484
       lnbit_count |   .0029001   .0006081     4.77   0.000     .0017082     .004092
             _cons |    3.39929   .0064401   527.83   0.000     3.386667    3.411912
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |    .050738   .0037391      .0439141    .0586223
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   2.07e-07   .0003879             0           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .0524307   .0007933      .0508986    .0540089
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 932.55                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(5,829 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(5829 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -6608.036           .  -6608.036  -6608.036

.                         predict REccode_yr REyear_yr, reffects level(_all);
(3,146 missing values generated)
(1,963 missing values generated)

.                 /* Figure R12 */        
>                 /* generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*cxconst + _b[1970b.year#clji] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                         forvalues year=1971(1)2000  {;
  2.                 replace MEslope_t = (_b[`year'.year#clji_democ])*cxconst + _b[`year'.year#clji] + REyear_yr if year==`year';
  3.                 };
(201 real changes made, 77 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 76 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(197 real changes made, 59 to missing)
(197 real changes made, 57 to missing)
(196 real changes made, 50 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 46 to missing)
(196 real changes made, 45 to missing)
(196 real changes made, 48 to missing)
(197 real changes made, 51 to missing)
(197 real changes made, 50 to missing)

.                                         /* Plot slope over time */
>                 collapse MEslope_t, by(xconst year time);

.                         twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lcolor(gs1
> 4)
>                         || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                         || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                         || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                         || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                         || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                         || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                 xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R12. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(LJI: BITs, Non-OECD)")
>                                 note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                 "lines indicate greater levels of Democracy.");

.                                         graph save Figure_R12, replace;
(note: file Figure_R12.gph not found)
(file Figure_R12.gph saved)

.                                                                 /* Sample: Net FDI/GDP */
> 
>         /* Table R4 Model 1 */
>         /* Fixed model */ 
>         use `temp', clear;

.         xtmixed FDIinflowsPctGDP cPRdemoc cefw2legalrights cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood = -4474.8286  
Iteration 1:   log likelihood = -4474.8286  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,528
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,528
                                                              avg =    1,528.0
                                                              max =      1,528

                                                Wald chi2(10)     =     145.94
Log likelihood = -4474.8286                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------
 FDIinflowsPctGDP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
         cPRdemoc |   .0824321     .04607     1.79   0.074    -.0078633    .1727276
 cefw2legalrights |   .2485103   .1367822     1.82   0.069    -.0195779    .5165984
          cxconst |   .0829303    .103204     0.80   0.422    -.1193457    .2852064
    cln_GDP2005US |  -.0304474   .1588654    -0.19   0.848     -.341818    .2809231
cln_GDP_pc2005USD |  -.4892127   .2539492    -1.93   0.054    -.9869441    .0085186
       cGDPgrowth |   .0668829   .0290571     2.30   0.021     .0099321    .1238337
     cTradePctGDP |    .043336   .0047453     9.13   0.000     .0340353    .0526366
          ckaopen |   .3801463   .1216284     3.13   0.002      .141759    .6185335
     cln_resource |  -.1038171    .157344    -0.66   0.509    -.4122057    .2045716
       cln_battle |   .0040827    .044234     0.09   0.926    -.0826143    .0907797
            _cons |   2.778899   .3718959     7.47   0.000     2.049997    3.507802
-----------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   1.917484   .1875967      1.582904    2.322785
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .8153168   .1990254      .5052906    1.315563
-----------------------------+------------------------------------------------
                sd(Residual) |   4.273492   .0815803      4.116552    4.436415
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 127.75                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1    8977.657           .   8977.657   8977.657

.                                         /* Figure R13 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R13. Marginal Effects of Property Rights on FDI." "(Net FDI as Percent GDP)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R13, replace;
(note: file Figure_R13.gph not found)
(file Figure_R13.gph saved)

.                 /* Table R4 Model 2 */
>         /* Time-varying model */ 
>                 use `temp', clear;

.                 xtmixed FDIinflowsPctGDP c.cPRdemoc#year c.cefw2legalrights#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_bat
> tle
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood = -4432.3153  
Iteration 1:   log likelihood = -4432.3153  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,528
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,528
                                                              avg =    1,528.0
                                                              max =      1,528

                                                Wald chi2(40)     =     249.75
Log likelihood = -4432.3153                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------------
       FDIinflowsPctGDP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        year#c.cPRdemoc |
                  1970  |  -.0062709   .1654084    -0.04   0.970    -.3304655    .3179236
                  1975  |  -.0527456   .1547729    -0.34   0.733     -.356095    .2506038
                  1980  |  -.0869454    .122356    -0.71   0.477    -.3267588    .1528681
                  1985  |  -.0784908   .1130877    -0.69   0.488    -.3001387     .143157
                  1990  |  -.0574702    .113694    -0.51   0.613    -.2803063    .1653659
                  1995  |  -.0261447   .1564737    -0.17   0.867    -.3328275    .2805382
                  2000  |   .4330089    .140445     3.08   0.002     .1577417     .708276
                  2001  |   .1296104   .1259693     1.03   0.304     -.117285    .3765057
                  2002  |   .4466806   .1243459     3.59   0.000     .2029671    .6903941
                  2003  |      .2272   .1204371     1.89   0.059    -.0088524    .4632524
                  2004  |  -.0221325   .1261561    -0.18   0.861     -.269394     .225129
                  2005  |   -.038134   .1313992    -0.29   0.772    -.2956717    .2194037
                  2006  |  -.1491894   .1404832    -1.06   0.288    -.4245314    .1261526
                  2007  |   .2775315   .1286181     2.16   0.031     .0254447    .5296184
                  2008  |   .1577377   .1411196     1.12   0.264    -.1188517    .4343271
                  2009  |   .1173005   .1689205     0.69   0.487    -.2137776    .4483785
                        |
year#c.cefw2legalrights |
                  1970  |      .3211   .4449413     0.72   0.470     -.550969    1.193169
                  1975  |   .0305022   .4170287     0.07   0.942     -.786859    .8478633
                  1980  |   .2836197   .3030676     0.94   0.349    -.3103819    .8776212
                  1985  |   .2173666   .2757734     0.79   0.431    -.3231394    .7578726
                  1990  |   .3678872   .2739692     1.34   0.179    -.1690825     .904857
                  1995  |   .3210849   .3890757     0.83   0.409    -.4414895    1.083659
                  2000  |   .9673141   .3440858     2.81   0.005     .2929183     1.64171
                  2001  |   .3006842   .2985648     1.01   0.314    -.2844919    .8858604
                  2002  |  -.6304204   .2900805    -2.17   0.030    -1.198968   -.0618732
                  2003  |   -.269051   .2832535    -0.95   0.342    -.8242177    .2861156
                  2004  |   .0208886   .3004627     0.07   0.945    -.5680075    .6097847
                  2005  |   .5159454   .3063645     1.68   0.092    -.0845181    1.116409
                  2006  |   .7139058   .3340841     2.14   0.033      .059113    1.368699
                  2007  |   .3200077   .3081375     1.04   0.299    -.2839308    .9239461
                  2008  |  -.2654114   .3348247    -0.79   0.428    -.9216556    .3908329
                  2009  |   -.158284   .3873331    -0.41   0.683     -.917443     .600875
                        |
                cxconst |   .0492361   .1030803     0.48   0.633    -.1527975    .2512697
          cln_GDP2005US |  -.0298735   .1567213    -0.19   0.849    -.3370415    .2772946
      cln_GDP_pc2005USD |    -.49697   .2519444    -1.97   0.049    -.9907719    -.003168
             cGDPgrowth |   .0606173   .0289097     2.10   0.036     .0039554    .1172792
           cTradePctGDP |   .0432843   .0046612     9.29   0.000     .0341485    .0524201
                ckaopen |   .4054167   .1192242     3.40   0.001     .1717415    .6390918
           cln_resource |  -.1122327   .1555146    -0.72   0.470    -.4170357    .1925703
             cln_battle |   .0015328   .0440765     0.03   0.972    -.0848556    .0879212
                  _cons |   2.813262    .345135     8.15   0.000      2.13681    3.489715
-----------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   1.908612   .1831659      1.581355    2.303593
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .6176483   .1873913      .3407934    1.119416
-----------------------------+------------------------------------------------
                sd(Residual) |    4.15835   .0794552        4.0055    4.317032
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 118.44                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(6,620 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(6620 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1    8952.631           .   8952.631   8952.631

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,982 missing values generated)
(4,981 missing values generated)

.                 /* Figure R14 */        
>                 /* generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#cPRdemoc])*cxconst + _b[1970b.year#cefw2legalrights] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                         forvalues year=1975(5)2000  {;
  2.                 replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                 };
(201 real changes made, 71 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 72 to missing)
(196 real changes made, 49 to missing)
(197 real changes made, 50 to missing)

.                         forvalues year=2001/2009  {;
  2.                 replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                 };
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                 replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                                 /* Plot slope over time */
>                 collapse MEslope_t, by(xconst year time);

.                         twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lcolor(gs1
> 4)
>                         || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                         || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                         || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                         || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                         || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                         || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                 xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R14. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(Net FDI as Percent GDP)")
>                                 note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                 "lines indicate greater levels of Democracy.");

.                                         graph save Figure_R14, replace;
(note: file Figure_R14.gph not found)
(file Figure_R14.gph saved)

.                         /* Table R4 Model 3 */  
>         /* lji */
>         /* Fixed model */ 
>         use `temp', clear;

.         xtmixed FDIinflowsPctGDP clji_democ clji cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood = -12246.439  
Iteration 1:   log likelihood = -12246.439  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,120
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,120
                                                              avg =    4,120.0
                                                              max =      4,120

                                                Wald chi2(10)     =     444.88
Log likelihood = -12246.439                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------
 FDIinflowsPctGDP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
       clji_democ |    1.25068    .276124     4.53   0.000     .7094873    1.791874
             clji |   .9489395   1.203814     0.79   0.431    -1.410493    3.308372
          cxconst |   .1850623   .1086505     1.70   0.089    -.0278887    .3980134
    cln_GDP2005US |   .2502859   .1437046     1.74   0.082    -.0313699    .5319418
cln_GDP_pc2005USD |   -1.25565   .2274456    -5.52   0.000    -1.701435   -.8098643
       cGDPgrowth |   .1557973   .0146237    10.65   0.000     .1271354    .1844593
     cTradePctGDP |   .0571943   .0037662    15.19   0.000     .0498127    .0645759
          ckaopen |   .2847426   .0795606     3.58   0.000     .1288066    .4406785
     cln_resource |   .2465712   .1225464     2.01   0.044     .0063847    .4867577
       cln_battle |  -.0233386   .0288875    -0.81   0.419     -.079957    .0332798
            _cons |   1.217318   .3351125     3.63   0.000     .5605097    1.874127
-----------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   2.334926   .1795995      2.008166    2.714853
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .8367459   .1373336      .6065791     1.15425
-----------------------------+------------------------------------------------
                sd(Residual) |   4.525424   .0512972      4.425992     4.62709
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 470.34                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1    24520.88           .   24520.88   24520.88

.                                         /* Figure R15 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R15. Marginal Effects of Property Rights on FDI." "(LJI: Net FDI as Percent GDP)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R15, replace;
(note: file Figure_R15.gph not found)
(file Figure_R15.gph saved)

.                 /* Table R4 Model 4 */
>         /* Time-varying model */ 
>                 use `temp', clear;

.                 xtmixed FDIinflowsPctGDP c.clji_democ#year c.clji#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood = -12139.388  
Iteration 1:   log likelihood = -12138.407  
Iteration 2:   log likelihood = -12138.268  
Iteration 3:   log likelihood = -12138.267  
Iteration 4:   log likelihood = -12138.267  
Iteration 5:   log likelihood = -12138.267  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,120
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,120
                                                              avg =    4,120.0
                                                              max =      4,120

                                                Wald chi2(88)     =     941.09
Log likelihood = -12138.267                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------
 FDIinflowsPctGDP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
year#c.clji_democ |
            1970  |    1.40548   .7464195     1.88   0.060    -.0574755    2.868435
            1971  |   1.258156   .7270614     1.73   0.084     -.166858     2.68317
            1972  |   1.034663   .7115906     1.45   0.146    -.3600289    2.429355
            1973  |   .8507935   .7073377     1.20   0.229    -.5355629     2.23715
            1974  |   .1245445   .6941395     0.18   0.858    -1.235944    1.485033
            1975  |   1.009568   .6725995     1.50   0.133    -.3087025    2.327839
            1976  |   .3139173    .644685     0.49   0.626    -.9496422    1.577477
            1977  |   .6207441    .605235     1.03   0.305    -.5654947    1.806983
            1978  |    .971398   .6202993     1.57   0.117    -.2443662    2.187162
            1979  |   .5216163   .6102532     0.85   0.393     -.674458    1.717691
            1980  |    .297221   .6051213     0.49   0.623     -.888795    1.483237
            1981  |   .6134768   .5951024     1.03   0.303    -.5529025    1.779856
            1982  |   .7561764    .594858     1.27   0.204    -.4097239    1.922077
            1983  |   .6340808   .5986535     1.06   0.290    -.5392586     1.80742
            1984  |   .2088032   .6007694     0.35   0.728    -.9686831     1.38629
            1985  |   .0879647    .592408     0.15   0.882    -1.073134    1.249063
            1986  |   .1765638    .588259     0.30   0.764    -.9764026     1.32953
            1987  |   .4448362   .5916659     0.75   0.452    -.7148078     1.60448
            1988  |   .1887274   .5874574     0.32   0.748    -.9626679    1.340123
            1989  |   .6662358   .6018443     1.11   0.268    -.5133573    1.845829
            1990  |   .6869331   .6147096     1.12   0.264    -.5178756    1.891742
            1991  |   1.524138   .6702666     2.27   0.023     .2104394    2.837836
            1992  |   .8845483    .691383     1.28   0.201    -.4705375    2.239634
            1993  |   1.286762   .7352784     1.75   0.080    -.1543575    2.727881
            1994  |   1.083799   .7457185     1.45   0.146    -.3777826     2.54538
            1995  |   2.629135   .7339442     3.58   0.000      1.19063    4.067639
            1996  |   4.883217   .6616963     7.38   0.000     3.586316    6.180118
            1997  |    2.61737   .6375113     4.11   0.000      1.36787    3.866869
            1998  |   4.348316   .6707791     6.48   0.000     3.033613    5.663019
            1999  |   5.263347    .685552     7.68   0.000      3.91969    6.607005
            2000  |   3.826077   .6654609     5.75   0.000     2.521797    5.130356
            2001  |   3.230815    .670499     4.82   0.000     1.916661    4.544969
            2002  |   3.719344   .6681567     5.57   0.000     2.409781    5.028907
            2003  |   3.078929   .6497441     4.74   0.000     1.805454    4.352404
            2004  |   1.979323   .6591732     3.00   0.003     .6873673    3.271279
            2005  |   2.098149   .6778277     3.10   0.002     .7696315    3.426667
            2006  |   3.067974   .6809227     4.51   0.000      1.73339    4.402558
            2007  |   4.641411   .6829828     6.80   0.000      3.30279    5.980033
            2008  |   3.617772   .7107195     5.09   0.000     2.224788    5.010757
            2009  |   3.132034   .7546456     4.15   0.000     1.652955    4.611112
                  |
      year#c.clji |
            1970  |   .2547174   2.296374     0.11   0.912    -4.246092    4.755527
            1971  |   1.515871   2.249128     0.67   0.500    -2.892338     5.92408
            1972  |   .4781147   2.211491     0.22   0.829    -3.856328    4.812558
            1973  |  -.3511986   2.193175    -0.16   0.873    -4.649743    3.947346
            1974  |   2.277332   2.195887     1.04   0.300    -2.026528    6.581192
            1975  |  -.2078544   2.142123    -0.10   0.923    -4.406339     3.99063
            1976  |   .4549538   2.088441     0.22   0.828    -3.638315    4.548223
            1977  |  -.0210889   1.983695    -0.01   0.992    -3.909059    3.866882
            1978  |  -.8917236   1.985151    -0.45   0.653    -4.782549    2.999101
            1979  |  -1.028715   1.947506    -0.53   0.597    -4.845756    2.788327
            1980  |    .171449   1.948844     0.09   0.930    -3.648215    3.991113
            1981  |  -.4987993   1.927423    -0.26   0.796    -4.276478     3.27888
            1982  |  -.8591571   1.921178    -0.45   0.655    -4.624598    2.906284
            1983  |   -.434617   1.938472    -0.22   0.823    -4.233952    3.364718
            1984  |  -.2416173   1.936636    -0.12   0.901    -4.037354     3.55412
            1985  |   .1737471   1.920812     0.09   0.928    -3.590975    3.938469
            1986  |   1.034507   1.905737     0.54   0.587    -2.700668    4.769682
            1987  |   .4271798    1.91201     0.22   0.823    -3.320291    4.174651
            1988  |   1.176186    1.91066     0.62   0.538    -2.568639    4.921011
            1989  |   .4700147   1.948045     0.24   0.809    -3.348082    4.288112
            1990  |    .825943   1.974066     0.42   0.676    -3.043156    4.695042
            1991  |  -1.568392   2.073389    -0.76   0.449    -5.632159    2.495375
            1992  |  -.4410917   2.116042    -0.21   0.835    -4.588457    3.706274
            1993  |  -1.208453   2.163379    -0.56   0.576    -5.448598    3.031691
            1994  |  -1.494575   2.182202    -0.68   0.493    -5.771612    2.782462
            1995  |  -4.223965   2.138964    -1.97   0.048    -8.416257   -.0316721
            1996  |  -10.77944   1.971404    -5.47   0.000    -14.64332   -6.915557
            1997  |  -3.290242   1.939281    -1.70   0.090    -7.091162    .5106793
            1998  |  -6.162852   1.982418    -3.11   0.002    -10.04832   -2.277385
            1999  |  -3.680986   2.018508    -1.82   0.068    -7.637189     .275216
            2000  |    5.18703   1.948698     2.66   0.008     1.367653    9.006408
            2001  |  -1.436462   1.975987    -0.73   0.467    -5.309326    2.436402
            2002  |  -4.197436   1.960585    -2.14   0.032    -8.040113    -.354759
            2003  |  -4.665774   1.935659    -2.41   0.016    -8.459596   -.8719525
            2004  |  -3.897965   1.966104    -1.98   0.047    -7.751459   -.0444709
            2005  |   -1.81386   1.969167    -0.92   0.357    -5.673357    2.045637
            2006  |  -2.821551   1.957211    -1.44   0.149    -6.657615    1.014512
            2007  |  -1.644301   1.958064    -0.84   0.401    -5.482035    2.193433
            2008  |  -3.394188   2.009564    -1.69   0.091    -7.332862    .5444858
            2009  |  -3.414115   2.072177    -1.65   0.099    -7.475507    .6472764
                  |
          cxconst |   .3444865   .1057943     3.26   0.001     .1371334    .5518395
    cln_GDP2005US |   .2667414   .1451696     1.84   0.066    -.0177857    .5512685
cln_GDP_pc2005USD |  -1.279266   .2310044    -5.54   0.000    -1.732027   -.8265063
       cGDPgrowth |   .1508406   .0145652    10.36   0.000     .1222933    .1793879
     cTradePctGDP |     .05834   .0036884    15.82   0.000     .0511109    .0655691
          ckaopen |   .3267609   .0787608     4.15   0.000     .1723926    .4811292
     cln_resource |   .2150308   .1228346     1.75   0.080    -.0257206    .4557822
       cln_battle |  -.0421468   .0282828    -1.49   0.136      -.09758    .0132864
            _cons |   .9723368   .3130486     3.11   0.002     .3587727    1.585901
-----------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   2.425908   .1860893      2.087274    2.819482
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0002792   .0567406      3.0e-177    2.6e+169
-----------------------------+------------------------------------------------
                sd(Residual) |     4.4311   .0499943      4.334188    4.530178
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 432.57                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(4,028 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(4028 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1    24460.54           .   24460.54   24460.54

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,121 missing values generated)
(194 missing values generated)

.                 /* Figure R16 */        
>                 /* generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*cxconst + _b[1970b.year#clji] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                         forvalues year=1971(1)2009  {;
  2.                                 replace MEslope_t = (_b[`year'.year#clji_democ])*cxconst + _b[`year'.year#clji] + REyear_yr if year==`year';
  3.                 };
(201 real changes made, 77 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 76 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(197 real changes made, 59 to missing)
(197 real changes made, 57 to missing)
(196 real changes made, 50 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 46 to missing)
(196 real changes made, 45 to missing)
(196 real changes made, 48 to missing)
(197 real changes made, 51 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                                 replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                         /* Plot slope over time */
>                 collapse MEslope_t, by(xconst year time);

.                         twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lcolor(gs1
> 4)
>                         || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                         || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                         || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                         || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                         || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                         || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                 xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R16. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(LJI: Net FDI as Percent GDP)
> ")
>                                 note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                 "lines indicate greater levels of Democracy.");

.                                         graph save Figure_R16, replace;
(note: file Figure_R16.gph not found)
(file Figure_R16.gph saved)

.                                                 /* Sample: Net FDI censored at zero */
>         
>         /* Table R5 Model 1 */
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed fdi_cen cPRdemoc cefw2legalrights cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood = -2470.1621  
Iteration 1:   log likelihood = -2470.1621  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,533
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,533
                                                              avg =    1,533.0
                                                              max =      1,533

                                                Wald chi2(10)     =     802.57
Log likelihood = -2470.1621                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------
          fdi_cen |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
         cPRdemoc |   .0152106   .0129613     1.17   0.241    -.0101931    .0406142
 cefw2legalrights |   .1905399   .0380627     5.01   0.000     .1159384    .2651414
          cxconst |   .0167879     .02989     0.56   0.574    -.0417954    .0753712
    cln_GDP2005US |   .8750777   .0548121    15.97   0.000     .7676479    .9825075
cln_GDP_pc2005USD |  -.1445678   .0826488    -1.75   0.080    -.3065565    .0174209
       cGDPgrowth |   .0375041   .0076748     4.89   0.000     .0224618    .0525465
     cTradePctGDP |   .0085535    .001517     5.64   0.000     .0055802    .0115268
          ckaopen |   .1046748   .0347331     3.01   0.003     .0365992    .1727505
     cln_resource |  -.0720913   .0499838    -1.44   0.149    -.1700577    .0258751
       cln_battle |   .0139121   .0123754     1.12   0.261    -.0103432    .0381674
            _cons |   -1.60891    .160631   -10.02   0.000    -1.923742   -1.294079
-----------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |    .748038   .0599481      .6393048    .8752646
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |     .49632   .0993411      .3352658     .734741
-----------------------------+------------------------------------------------
                sd(Residual) |   1.107135   .0211048      1.066534    1.149282
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 394.30                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1    4968.324           .   4968.324   4968.324

.                                         /* Figure R17 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* Create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R17. Marginal Effects of Property Rights on FDI." "(Log of censored net FDI)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R17, replace;
(note: file Figure_R17.gph not found)
(file Figure_R17.gph saved)

.                 /* Table R5 Model 2 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed fdi_cen c.cPRdemoc#year c.cefw2legalrights#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood = -2421.0089  
Iteration 1:   log likelihood = -2421.0089  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,533
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,533
                                                              avg =    1,533.0
                                                              max =      1,533

                                                Wald chi2(40)     =     913.37
Log likelihood = -2421.0089                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------------
                fdi_cen |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        year#c.cPRdemoc |
                  1970  |   .0255628   .0471915     0.54   0.588    -.0669309    .1180565
                  1975  |   .0473684   .0413629     1.15   0.252    -.0337014    .1284383
                  1980  |   .0392341   .0342405     1.15   0.252     -.027876    .1063443
                  1985  |   .0043427   .0313591     0.14   0.890      -.05712    .0658055
                  1990  |   .0210967   .0312908     0.67   0.500    -.0402321    .0824255
                  1995  |   .0355115   .0421083     0.84   0.399    -.0470193    .1180424
                  2000  |   .0978719   .0377383     2.59   0.010     .0239061    .1718377
                  2001  |   .0020505   .0337655     0.06   0.952    -.0641287    .0682296
                  2002  |    .056327   .0332247     1.70   0.090    -.0087923    .1214463
                  2003  |   .0427968   .0322273     1.33   0.184    -.0203675     .105961
                  2004  |  -.1133045   .0337998    -3.35   0.001     -.179551    -.047058
                  2005  |  -.0196231   .0353268    -0.56   0.579    -.0888624    .0496162
                  2006  |  -.0404242   .0373467    -1.08   0.279    -.1136224     .032774
                  2007  |   .0282266   .0342017     0.83   0.409    -.0388074    .0952607
                  2008  |   .0561115   .0378125     1.48   0.138    -.0179997    .1302227
                  2009  |    -.06368   .0451879    -1.41   0.159    -.1522467    .0248867
                        |
year#c.cefw2legalrights |
                  1970  |   .3880409   .1165689     3.33   0.001       .15957    .6165118
                  1975  |   .2549985    .121358     2.10   0.036     .0171412    .4928557
                  1980  |    .114385   .0793409     1.44   0.149    -.0411203    .2698903
                  1985  |   .1995718   .0742768     2.69   0.007      .053992    .3451515
                  1990  |   .3203986   .0732033     4.38   0.000     .1769228    .4638744
                  1995  |   .1253071     .10214     1.23   0.220    -.0748837    .3254978
                  2000  |   .2440479   .0902238     2.70   0.007     .0672125    .4208832
                  2001  |   .2099719   .0790698     2.66   0.008      .054998    .3649458
                  2002  |   .1150192   .0768034     1.50   0.134    -.0355127    .2655511
                  2003  |    .104682   .0750446     1.39   0.163    -.0424027    .2517667
                  2004  |   .1108679   .0802855     1.38   0.167    -.0464887    .2682245
                  2005  |   .3453788    .080587     4.29   0.000     .1874312    .5033265
                  2006  |   .3841034   .0872827     4.40   0.000     .2130323    .5551744
                  2007  |   .3291584   .0805367     4.09   0.000     .1713093    .4870075
                  2008  |   .1806496   .0882001     2.05   0.041     .0077805    .3535186
                  2009  |   .2027909   .1023388     1.98   0.048     .0022105    .4033713
                        |
                cxconst |   .0119317    .029939     0.40   0.690    -.0467477    .0706111
          cln_GDP2005US |   .8647352   .0546062    15.84   0.000      .757709    .9717614
      cln_GDP_pc2005USD |  -.1454583   .0828899    -1.75   0.079    -.3079196    .0170029
             cGDPgrowth |   .0333464   .0076495     4.36   0.000     .0183538    .0483391
           cTradePctGDP |   .0077816   .0015044     5.17   0.000      .004833    .0107301
                ckaopen |   .0975784   .0341615     2.86   0.004     .0306231    .1645337
           cln_resource |  -.0699717   .0496399    -1.41   0.159    -.1672642    .0273207
             cln_battle |   .0136197   .0122901     1.11   0.268    -.0104685    .0377079
                  _cons |  -1.599941    .165317    -9.68   0.000    -1.923956   -1.275925
-----------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .7505121   .0590331      .6432869      .87561
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |    .521321   .1062483      .3496434    .7772937
-----------------------------+------------------------------------------------
                sd(Residual) |    1.06846   .0203737      1.029266    1.109148
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 388.11                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(6,615 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(6615 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1    4930.018           .   4930.018   4930.018

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,941 missing values generated)
(4,981 missing values generated)

.                 /* Figure R18 */        
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#cPRdemoc])*cxconst + _b[1970b.year#cefw2legalrights] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                         forvalues year=1975(5)2000  {;
  2.                                         replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(201 real changes made, 71 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 72 to missing)
(196 real changes made, 49 to missing)
(197 real changes made, 50 to missing)

.                                         forvalues year=2001/2009  {;
  2.                                         replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                                         /* Plot slope over time */
>                         collapse MEslope_t, by(xconst year time);

.                         #delimit;
delimiter now ;
.                                 twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lc
> olor(gs14)
>                                 || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R18. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(Log of censored net 
> FDI)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R18, replace;
(note: file Figure_R18.gph not found)
(file Figure_R18.gph saved)

.                                                 /* Table R5 Model 3 */                          
>         /* lji */
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed fdi_cen clji_democ clji cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood = -6483.2166  
Iteration 1:   log likelihood = -6483.2166  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,148
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,148
                                                              avg =    4,148.0
                                                              max =      4,148

                                                Wald chi2(10)     =    1082.03
Log likelihood = -6483.2166                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------
          fdi_cen |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
       clji_democ |   .2893283   .0689512     4.20   0.000     .1541863    .4244702
             clji |   .4163104    .314917     1.32   0.186    -.2009157    1.033536
          cxconst |   .0038702   .0271028     0.14   0.886    -.0492502    .0569906
    cln_GDP2005US |   .7994195   .0451942    17.69   0.000     .7108404    .8879986
cln_GDP_pc2005USD |  -.0507031   .0656358    -0.77   0.440    -.1793469    .0779407
       cGDPgrowth |    .017832   .0034862     5.11   0.000     .0109991    .0246649
     cTradePctGDP |   .0101452   .0010002    10.14   0.000     .0081848    .0121055
          ckaopen |   .1314655   .0201061     6.54   0.000     .0920582    .1708728
     cln_resource |   .0265112   .0327467     0.81   0.418    -.0376712    .0906936
       cln_battle |    .022287   .0071371     3.12   0.002     .0082986    .0362755
            _cons |  -2.057691   .1167167   -17.63   0.000    -2.286451    -1.82893
-----------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .8022738   .0526388      .7054619    .9123713
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .4727653   .0587152      .3706214    .6030602
-----------------------------+------------------------------------------------
                sd(Residual) |   1.084934   .0122123      1.061261    1.109136
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1541.57               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1    12994.43           .   12994.43   12994.43

.                                         /* Figure 19 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R19. Marginal Effects of Property Rights on FDI." "(LJI: Log of censored net FDI)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R19, replace;
(note: file Figure_R19.gph not found)
(file Figure_R19.gph saved)

.                                                 /* Table R5 Model 4 */                          
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed fdi_cen c.clji_democ#year c.clji#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood = -6387.3703  
Iteration 1:   log likelihood = -6387.3703  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,148
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,148
                                                              avg =    4,148.0
                                                              max =      4,148

                                                Wald chi2(88)     =    1385.20
Log likelihood = -6387.3703                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------
          fdi_cen |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
year#c.clji_democ |
            1970  |   .5317366   .2669574     1.99   0.046     .0085098    1.054963
            1971  |   .1331171   .2715739     0.49   0.624     -.399158    .6653922
            1972  |    .497099   .2698266     1.84   0.065    -.0317515    1.025949
            1973  |    .286161   .2593093     1.10   0.270    -.2220759    .7943979
            1974  |   .5197634   .2544831     2.04   0.041     .0209857    1.018541
            1975  |    .527719   .2401579     2.20   0.028     .0570181    .9984198
            1976  |  -.0342339   .2332534    -0.15   0.883    -.4914022    .4229344
            1977  |   .0932236   .2261082     0.41   0.680    -.3499403    .5363875
            1978  |   .1781881   .2245557     0.79   0.427     -.261933    .6183091
            1979  |  -.1188638   .2147169    -0.55   0.580    -.5397013    .3019736
            1980  |  -.0399025    .216819    -0.18   0.854      -.46486     .385055
            1981  |  -.0105449   .2183284    -0.05   0.961    -.4384607    .4173709
            1982  |    .049094   .2119147     0.23   0.817    -.3662511    .4644391
            1983  |   .0219145   .2115252     0.10   0.917    -.3926673    .4364963
            1984  |  -.3280177   .2115148    -1.55   0.121    -.7425791    .0865437
            1985  |   .0008801   .2102863     0.00   0.997    -.4112735    .4130338
            1986  |  -.0638132   .2040629    -0.31   0.754    -.4637691    .3361427
            1987  |   .0208122   .2029743     0.10   0.918    -.3770101    .4186345
            1988  |  -.0998045   .1993251    -0.50   0.617    -.4904745    .2908656
            1989  |  -.0136019    .205093    -0.07   0.947    -.4155768     .388373
            1990  |   .2475083   .2015082     1.23   0.219    -.1474405    .6424571
            1991  |   .1226053   .2115943     0.58   0.562    -.2921119    .5373225
            1992  |   -.261894    .216004    -1.21   0.225    -.6852541    .1614661
            1993  |   .1745184   .2307749     0.76   0.450     -.277792    .6268289
            1994  |   .5326418   .2310881     2.30   0.021     .0797175    .9855662
            1995  |   .1653445   .2301254     0.72   0.472    -.2856929     .616382
            1996  |   .2709193   .2114526     1.28   0.200    -.1435203    .6853588
            1997  |   .3922584   .2056366     1.91   0.056    -.0107819    .7952986
            1998  |    .310253   .2144696     1.45   0.148    -.1100997    .7306058
            1999  |   .7197573   .2164018     3.33   0.001     .2956176    1.143897
            2000  |   .6861466   .2141734     3.20   0.001     .2663745    1.105919
            2001  |   .2530073   .2127986     1.19   0.234    -.1640702    .6700848
            2002  |   .6863833   .2088125     3.29   0.001     .2771184    1.095648
            2003  |   .5217959   .2099082     2.49   0.013     .1103833    .9332085
            2004  |  -.1893783     .21288    -0.89   0.374    -.6066154    .2278589
            2005  |   .5380443   .2189336     2.46   0.014     .1089424    .9671462
            2006  |   .5803935   .2169415     2.68   0.007      .155196    1.005591
            2007  |   .8504366   .2198555     3.87   0.000     .4195277    1.281346
            2008  |   .7112213   .2264826     3.14   0.002     .2673236    1.155119
            2009  |   .7361531   .2367786     3.11   0.002     .2720755    1.200231
                  |
      year#c.clji |
            1970  |   .6822182   .5678737     1.20   0.230    -.4307938     1.79523
            1971  |   1.050001   .5570129     1.89   0.059    -.0417241    2.141726
            1972  |   .1683174    .548913     0.31   0.759    -.9075324    1.244167
            1973  |  -.1283967   .5470243    -0.23   0.814    -1.200545    .9437512
            1974  |   .5314467   .5449909     0.98   0.329    -.5367158    1.599609
            1975  |  -.4170562   .5334972    -0.78   0.434    -1.462692    .6285791
            1976  |  -.3909206   .5187547    -0.75   0.451    -1.407661    .6258199
            1977  |  -.4221318   .4948392    -0.85   0.394    -1.391999    .5477351
            1978  |  -.9103848   .4970289    -1.83   0.067    -1.884544    .0637739
            1979  |   -.188224    .488502    -0.39   0.700     -1.14567    .7692222
            1980  |  -.2427257   .4885885    -0.50   0.619    -1.200342    .7148902
            1981  |    .114855   .4829361     0.24   0.812    -.8316823    1.061392
            1982  |  -.3412264   .4826492    -0.71   0.480    -1.287201    .6047486
            1983  |   .2265229   .4870795     0.47   0.642    -.7281354    1.181181
            1984  |  -.4851674   .4870508    -1.00   0.319    -1.439769    .4694347
            1985  |  -.0849409   .4829184    -0.18   0.860    -1.031444    .8615618
            1986  |   .0486617   .4821224     0.10   0.920    -.8962809    .9936043
            1987  |   .6514137   .4834364     1.35   0.178    -.2961043    1.598932
            1988  |   .8749978   .4834889     1.81   0.070     -.072623    1.822619
            1989  |   .9902929   .4915045     2.01   0.044     .0269618    1.953624
            1990  |    1.16161   .4929819     2.36   0.018     .1953837    2.127837
            1991  |   .5762514    .512693     1.12   0.261    -.4286084    1.581111
            1992  |   .5494306   .5229544     1.05   0.293    -.4755412    1.574402
            1993  |    .409582   .5365831     0.76   0.445    -.6421015    1.461265
            1994  |   .1489477   .5378469     0.28   0.782    -.9052128    1.203108
            1995  |   .9200969   .5312368     1.73   0.083    -.1211081    1.961302
            1996  |   .5414862   .4957992     1.09   0.275    -.4302623    1.513235
            1997  |   .7055407   .4892926     1.44   0.149    -.2534553    1.664537
            1998  |   .8978766   .5125639     1.75   0.080    -.1067302    1.902483
            1999  |   .8945399   .5124261     1.75   0.081    -.1097968    1.898877
            2000  |   1.613131   .5069313     3.18   0.001     .6195635    2.606698
            2001  |   1.345699   .5112516     2.63   0.008     .3436646    2.347734
            2002  |   .2552615   .5002955     0.51   0.610    -.7252997    1.235823
            2003  |   .3555359   .4998181     0.71   0.477    -.6240896    1.335161
            2004  |  -.3259947   .5064352    -0.64   0.520    -1.318589       .6666
            2005  |   .1429354   .5116198     0.28   0.780    -.8598209    1.145692
            2006  |   .0165931   .5105371     0.03   0.974    -.9840412    1.017227
            2007  |    .197992   .5105797     0.39   0.698    -.8027257     1.19871
            2008  |  -.1017987   .5235026    -0.19   0.846    -1.127845    .9242476
            2009  |  -.9459198   .5434224    -1.74   0.082    -2.011008    .1191685
                  |
          cxconst |   .0300983   .0270739     1.11   0.266    -.0229656    .0831622
    cln_GDP2005US |   .8410499   .0448307    18.76   0.000     .7531833    .9289165
cln_GDP_pc2005USD |  -.1428755   .0656934    -2.17   0.030    -.2716323   -.0141188
       cGDPgrowth |   .0168174   .0034846     4.83   0.000     .0099876    .0236471
     cTradePctGDP |   .0107323   .0009863    10.88   0.000     .0087992    .0126653
          ckaopen |   .1310978   .0202111     6.49   0.000     .0914849    .1707108
     cln_resource |   .0181211   .0326249     0.56   0.579    -.0458225    .0820647
       cln_battle |   .0296829   .0070669     4.20   0.000      .015832    .0435337
            _cons |  -2.058012    .104632   -19.67   0.000    -2.263088   -1.852937
-----------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .7989947   .0523913      .7026342    .9085703
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .3405065   .0596797      .2415113    .4800797
-----------------------------+------------------------------------------------
                sd(Residual) |   1.062441   .0120016      1.039177    1.086226
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1259.81               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(4,000 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(4000 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1    12958.74           .   12958.74   12958.74

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,039 missing values generated)
(194 missing values generated)

.                 /* Figure R20 */        
>                 /* generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*cxconst + _b[1970b.year#clji] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                                         forvalues year=1971(1)2009  {;
  2.                                                 replace MEslope_t = (_b[`year'.year#clji_democ])*cxconst + _b[`year'.year#clji] + REyear_yr if year==`year';
  3.                         };
(201 real changes made, 77 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 76 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(197 real changes made, 59 to missing)
(197 real changes made, 57 to missing)
(196 real changes made, 50 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 46 to missing)
(196 real changes made, 45 to missing)
(196 real changes made, 48 to missing)
(197 real changes made, 51 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                                                 /* Plot slope over time */
>                         collapse MEslope_t, by(xconst year time);

.                                 twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lc
> olor(gs14)
>                                 || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R20. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(LJI: Log of censored
>  net FDI)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R20, replace;
(note: file Figure_R20.gph not found)
(file Figure_R20.gph saved)

.                                                                                         /* Sample: using polity2 as alternative democracy measure */
>         
>         /* Table R6 Model 1 */
>         /* Fixed model */
>         use `temp', clear;

.                 xtmixed ln_FDI_net_inflows cPRpolity cefw2legalrights polity2 cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  106.44478  
Iteration 1:   log likelihood =  106.44478  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,566
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,566
                                                              avg =    1,566.0
                                                              max =      1,566

                                                Wald chi2(10)     =     238.84
Log likelihood =  106.44478                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
         cPRpolity |   .0026078   .0007847     3.32   0.001     .0010698    .0041458
  cefw2legalrights |  -.0163685   .0070757    -2.31   0.021    -.0302366   -.0025003
           polity2 |  -.0043394   .0018141    -2.39   0.017    -.0078951   -.0007838
     cln_GDP2005US |   .1065801   .0118973     8.96   0.000     .0832618    .1298983
 cln_GDP_pc2005USD |   .0076779   .0172376     0.45   0.656    -.0261072    .0414631
        cGDPgrowth |  -.0001857   .0013787    -0.13   0.893    -.0028878    .0025165
      cTradePctGDP |   .0011101   .0003067     3.62   0.000     .0005091    .0017112
           ckaopen |   .0062359   .0064826     0.96   0.336    -.0064697    .0189415
      cln_resource |  -.0429179   .0101565    -4.23   0.000    -.0628243   -.0230116
        cln_battle |  -.0036328   .0022369    -1.62   0.104    -.0080171    .0007514
             _cons |   3.394377   .0297227   114.20   0.000     3.336122    3.452633
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1721679   .0125535      .1492408    .1986171
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0788154   .0171187      .0514909    .1206402
-----------------------------+------------------------------------------------
                sd(Residual) |   .2037697   .0038357      .1963888     .211428
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 584.12                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -184.8896           .  -184.8896  -184.8896

.                                         /* Figure R21 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) polity2;

.                         expand 21;
(20 observations created)

.                         replace polity2 = _n-11;
(21 real changes made)

.                                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(20,979 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + polity2*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(polity2);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

. ;
.                                 /* create a kdensity plot */
>                         mkmat polity2-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep polity2;

.                         rename polity2 kdensity_polity2;

.                         svmat collapsed, names(col);

.                                                         /* Graph marginal effects */
>                                 twoway lowess gamma polity2, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo polity2, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi polity2, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_polity2, n(21) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R21. Marginal Effects of Property Rights on FDI." "(21-pt Democracy Scale)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R21, replace;
(note: file Figure_R21.gph not found)
(file Figure_R21.gph saved)

.                 /* Table R6 Model 2 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.cPRpolity#year c.cefw2legalrights#year polity2 cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_
> battle
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  267.35768  
Iteration 1:   log likelihood =  267.35768  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,566
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,566
                                                              avg =    1,566.0
                                                              max =      1,566

                                                Wald chi2(40)     =     616.08
Log likelihood =  267.35768                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------------
     ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
       year#c.cPRpolity |
                  1970  |  -.0033353   .0026848    -1.24   0.214    -.0085974    .0019267
                  1975  |  -.0011357    .002342    -0.48   0.628     -.005726    .0034546
                  1980  |  -.0024719   .0018146    -1.36   0.173    -.0060285    .0010846
                  1985  |  -.0016812   .0017032    -0.99   0.324    -.0050193    .0016569
                  1990  |  -.0001512   .0017502    -0.09   0.931    -.0035814    .0032791
                  1995  |  -.0011053   .0023038    -0.48   0.631    -.0056206    .0034101
                  2000  |   .0095323   .0021157     4.51   0.000     .0053856    .0136791
                  2001  |   .0024906   .0019967     1.25   0.212    -.0014228     .006404
                  2002  |   .0019213   .0019535     0.98   0.325    -.0019076    .0057502
                  2003  |   -.000312    .001878    -0.17   0.868    -.0039928    .0033687
                  2004  |  -.0035344   .0019614    -1.80   0.072    -.0073786    .0003098
                  2005  |   .0026143   .0020363     1.28   0.199    -.0013767    .0066054
                  2006  |   .0052132   .0021401     2.44   0.015     .0010188    .0094077
                  2007  |   .0089564   .0019588     4.57   0.000     .0051172    .0127957
                  2008  |   .0054162   .0022223     2.44   0.015     .0010606    .0097718
                  2009  |   -.001252   .0027064    -0.46   0.644    -.0065565    .0040525
                        |
year#c.cefw2legalrights |
                  1970  |  -.0546961   .0190477    -2.87   0.004    -.0920289   -.0173633
                  1975  |   -.071228   .0198378    -3.59   0.000    -.1101094   -.0323467
                  1980  |  -.0510955   .0129199    -3.95   0.000    -.0764181   -.0257729
                  1985  |  -.0634844   .0126377    -5.02   0.000    -.0882538    -.038715
                  1990  |   -.033719   .0127106    -2.65   0.008    -.0586313   -.0088067
                  1995  |   -.020348   .0179954    -1.13   0.258    -.0556183    .0149222
                  2000  |    .027373   .0161726     1.69   0.091    -.0043246    .0590706
                  2001  |   .0104479    .014739     0.71   0.478    -.0184399    .0393357
                  2002  |  -.0001641   .0142878    -0.01   0.991    -.0281676    .0278395
                  2003  |   -.004151    .013862    -0.30   0.765      -.03132    .0230179
                  2004  |   -.009441   .0146441    -0.64   0.519    -.0381429    .0192608
                  2005  |   .0172494   .0146794     1.18   0.240    -.0115218    .0460205
                  2006  |    .037936   .0159162     2.38   0.017     .0067408    .0691312
                  2007  |   .0578438   .0145157     3.98   0.000     .0293935    .0862942
                  2008  |   .0279988   .0162121     1.73   0.084    -.0037762    .0597739
                  2009  |   .0196345   .0190273     1.03   0.302    -.0176583    .0569273
                        |
                polity2 |  -.0015852   .0017178    -0.92   0.356     -.004952    .0017817
          cln_GDP2005US |   .1127774    .011889     9.49   0.000     .0894754    .1360794
      cln_GDP_pc2005USD |   -.021814   .0171835    -1.27   0.204     -.055493     .011865
             cGDPgrowth |   .0001775   .0012763     0.14   0.889    -.0023239     .002679
           cTradePctGDP |   .0011012   .0002917     3.78   0.000     .0005295    .0016729
                ckaopen |   .0056818   .0059384     0.96   0.339    -.0059572    .0173209
           cln_resource |  -.0342172   .0097419    -3.51   0.000     -.053311   -.0151234
             cln_battle |  -.0012292   .0020832    -0.59   0.555    -.0053122    .0028538
                  _cons |   3.378338   .0270964   124.68   0.000      3.32523    3.431446
-----------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |    .177066   .0123242      .1544861    .2029461
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0626741   .0157239      .0383298    .1024802
-----------------------------+------------------------------------------------
                sd(Residual) |   .1822106   .0034299      .1756105    .1890587
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 716.12                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(6,582 missing values generated)

.                 matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -446.7153           .  -446.7153  -446.7153

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,941 missing values generated)
(4,981 missing values generated)

.                 /* Figure R22 */        
>                 /* generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#cPRpolity])*polity2 + _b[1970b.year#cefw2legalrights] + REyear_yr if year==1970;
(8,024 missing values generated)

.                 gen MEslope_t=0;

.                                         forvalues year=1975(5)2000  {;
  2.                                                 replace MEslope_t = (_b[`year'.year#cPRpolity])*polity2 + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(201 real changes made, 67 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 67 to missing)
(196 real changes made, 42 to missing)
(197 real changes made, 43 to missing)

.                                         forvalues year=2001/2009  {;
  2.                                         replace MEslope_t = (_b[`year'.year#cPRpolity])*polity2 + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(197 real changes made, 44 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 42 to missing)
(197 real changes made, 41 to missing)
(197 real changes made, 42 to missing)
(195 real changes made, 39 to missing)
(195 real changes made, 39 to missing)

.                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 77 to missing)

.                                 /* Plot slope over time */
>                         collapse MEslope_t, by(polity2 year time);

.                         #delimit;
delimiter now ;
.                                 twoway connected MEslope_t year if year<2010 & polity2==(-10) & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs1
> 4) lcolor(gs14)
>                                 || connected MEslope_t year if year<2010 & polity2==(-9) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs13) lcolor(gs13)
>                                 || connected MEslope_t year if year<2010 & polity2==(-8) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs13) lcolor(gs13)
>                                 || connected MEslope_t year if year<2010 & polity2==(-7) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & polity2==(-6) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & polity2==(-5) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs11) lcolor(gs11)
>                                 || connected MEslope_t year if year<2010 & polity2==(-4) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & polity2==(-3) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs9) lcolor(gs9)
>                                 || connected MEslope_t year if year<2010 & polity2==(-2) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs9) lcolor(gs9)
>                                 || connected MEslope_t year if year<2010 & polity2==(-1) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & polity2==0 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs7) lcolor(gs7)
>                                 || connected MEslope_t year if year<2010 & polity2==1 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs7) lcolor(gs7)
>                                 || connected MEslope_t year if year<2010 & polity2==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & polity2==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs5) lcolor(gs5)
>                                 || connected MEslope_t year if year<2010 & polity2==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs5) lcolor(gs5)
>                                 || connected MEslope_t year if year<2010 & polity2==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & polity2==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs3) lcolor(gs3)
>                                 || connected MEslope_t year if year<2010 & polity2==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2)
>                                 || connected MEslope_t year if year<2010 & polity2==8 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2)
>                                 || connected MEslope_t year if year<2010 & polity2==9 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs1) lcolor(gs1)
>                                 || connected MEslope_t year if year<2010 & polity2==10 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs0) lcolor(gs0)         
>            
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R22. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(21-pt Democracy Scal
> e)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R22, replace;
(note: file Figure_R22.gph not found)
(file Figure_R22.gph saved)

.                                                 /* Table R6 Model 3 */                          
>         /* lji */
>         /* Fixed model */
>         use `temp', clear;

.                 xtmixed ln_FDI_net_inflows clji_democ clji polity2 cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1392.5829  
Iteration 1:   log likelihood =  1392.5829  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,148
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,148
                                                              avg =    4,148.0
                                                              max =      4,148

                                                Wald chi2(10)     =     322.96
Log likelihood =  1392.5829                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        clji_democ |   .0502454   .0098937     5.08   0.000      .030854    .0696367
              clji |   .0754318   .0415897     1.81   0.070    -.0060825    .1569462
           polity2 |  -.0047579   .0011476    -4.15   0.000    -.0070071   -.0025087
     cln_GDP2005US |   .0463138   .0075264     6.15   0.000     .0315623    .0610654
 cln_GDP_pc2005USD |   .0208087   .0107136     1.94   0.052    -.0001895    .0418069
        cGDPgrowth |  -.0007013   .0005217    -1.34   0.179    -.0017239    .0003213
      cTradePctGDP |   .0007974   .0001534     5.20   0.000     .0004969     .001098
           ckaopen |   .0051043   .0030334     1.68   0.092    -.0008411    .0110497
      cln_resource |  -.0260949   .0050595    -5.16   0.000    -.0360114   -.0161784
        cln_battle |   -.001193   .0010689    -1.12   0.264     -.003288    .0009019
             _cons |   3.403017   .0173867   195.73   0.000      3.36894    3.437095
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1381163   .0097042      .1203479     .158508
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0583895   .0078029       .044935    .0758727
-----------------------------+------------------------------------------------
                sd(Residual) |   .1619873   .0018356      .1584292    .1656252
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1694.01               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -2757.166           .  -2757.166  -2757.166

.                                         /* Figure R23 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) polity2;

.                         expand 21;
(20 observations created)

.                         replace polity2 = _n-11;
(21 real changes made)

.                                                         /* Take 1000 draws from actual values */
>                         expand 1000;
(20,979 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + polity2*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(polity2);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

. ;
.                                 /* create a kdensity plot */
>                         mkmat polity2-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep polity2;

.                         rename polity2 kdensity_polity2;

.                         svmat collapsed, names(col);

.                                                         /* Graph marginal effects */
>                                 twoway lowess gamma polity2, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo polity2, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi polity2, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_polity2, n(21) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R23. Marginal Effects of Property Rights on FDI." "(LJI: 21-pt Democracy Scale)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R23, replace;
(note: file Figure_R23.gph not found)
(file Figure_R23.gph saved)

.                 /* Table R6 Model 4 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.clji_democ#year c.clji#year polity2 cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1782.1579  
Iteration 1:   log likelihood =  1783.2024  
Iteration 2:   log likelihood =  1783.2493  
Iteration 3:   log likelihood =  1783.2493  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,148
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,148
                                                              avg =    4,148.0
                                                              max =      4,148

                                                Wald chi2(88)     =    1965.06
Log likelihood =  1783.2493                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
 year#c.clji_democ |
             1970  |  -.0253726   .0252824    -1.00   0.316    -.0749251      .02418
             1971  |  -.0577501   .0246208    -2.35   0.019     -.106006   -.0094942
             1972  |  -.0596187   .0241041    -2.47   0.013    -.1068619   -.0123755
             1973  |  -.0570656   .0239529    -2.38   0.017    -.1040124   -.0101188
             1974  |  -.0523245   .0234913    -2.23   0.026    -.0983666   -.0062824
             1975  |  -.0464486    .022834    -2.03   0.042    -.0912024   -.0016948
             1976  |   -.051856   .0217931    -2.38   0.017    -.0945697   -.0091422
             1977  |  -.0335392   .0204622    -1.64   0.101    -.0736443    .0065659
             1978  |  -.0371254   .0209847    -1.77   0.077    -.0782547    .0040039
             1979  |  -.0325882   .0206384    -1.58   0.114    -.0730387    .0078623
             1980  |  -.0260769   .0205201    -1.27   0.204    -.0662955    .0141418
             1981  |  -.0291913   .0201551    -1.45   0.148    -.0686945     .010312
             1982  |  -.0346516   .0201229    -1.72   0.085    -.0740917    .0047884
             1983  |  -.0322672   .0202311    -1.59   0.111    -.0719195     .007385
             1984  |  -.0345166   .0203007    -1.70   0.089    -.0743052    .0052721
             1985  |  -.0358055   .0200366    -1.79   0.074    -.0750765    .0034655
             1986  |  -.0214937   .0198784    -1.08   0.280    -.0604546    .0174673
             1987  |  -.0079963   .0200128    -0.40   0.689    -.0472206     .031228
             1988  |  -.0011248   .0198579    -0.06   0.955    -.0400456    .0377961
             1989  |   .0040987   .0203356     0.20   0.840    -.0357583    .0439558
             1990  |  -.0017743   .0204437    -0.09   0.931    -.0418432    .0382947
             1991  |  -.0301087   .0221016    -1.36   0.173    -.0734271    .0132097
             1992  |  -.0295472   .0226566    -1.30   0.192    -.0739533    .0148589
             1993  |  -.0053568   .0240041    -0.22   0.823     -.052404    .0416905
             1994  |  -.0036419   .0242754    -0.15   0.881    -.0512209     .043937
             1995  |   .0037954   .0239272     0.16   0.874     -.043101    .0506918
             1996  |   .0085693   .0218392     0.39   0.695    -.0342346    .0513733
             1997  |   .0273561   .0210732     1.30   0.194    -.0139466    .0686587
             1998  |   .0708457   .0226736     3.12   0.002     .0264063    .1152851
             1999  |   .1091905   .0225476     4.84   0.000     .0649979     .153383
             2000  |   .1675925    .022555     7.43   0.000     .1233856    .2117994
             2001  |   .0807113   .0225051     3.59   0.000     .0366021    .1248205
             2002  |   .0591119   .0218983     2.70   0.007      .016192    .1020318
             2003  |   .0280803   .0218184     1.29   0.198     -.014683    .0708435
             2004  |   .0008978   .0221399     0.04   0.968    -.0424955    .0442911
             2005  |   .0979527   .0228054     4.30   0.000      .053255    .1426505
             2006  |   .1682555   .0229255     7.34   0.000     .1233224    .2131886
             2007  |   .2373139   .0230359    10.30   0.000     .1921643    .2824635
             2008  |    .161512   .0239436     6.75   0.000     .1145835    .2084406
             2009  |   .1023679   .0253626     4.04   0.000      .052658    .1520777
                   |
       year#c.clji |
             1970  |  -.1484202   .0759923    -1.95   0.051    -.2973625     .000522
             1971  |  -.2348102    .074569    -3.15   0.002    -.3809627   -.0886577
             1972  |  -.2575482   .0735795    -3.50   0.000    -.4017612   -.1133351
             1973  |  -.2428429   .0729504    -3.33   0.001    -.3858231   -.0998627
             1974  |  -.1958678   .0729593    -2.68   0.007    -.3388653   -.0528702
             1975  |  -.2424112   .0712444    -3.40   0.001    -.3820476   -.1027747
             1976  |  -.2370654   .0692906    -3.42   0.001    -.3728724   -.1012584
             1977  |  -.1817942   .0656783    -2.77   0.006    -.3105213    -.053067
             1978  |  -.1805746   .0659293    -2.74   0.006    -.3097936   -.0513556
             1979  |  -.1559514   .0646678    -2.41   0.016     -.282698   -.0292047
             1980  |    -.13004   .0647322    -2.01   0.045    -.2569128   -.0031672
             1981  |  -.1735838   .0639318    -2.72   0.007    -.2988879   -.0482797
             1982  |  -.2111061   .0638228    -3.31   0.001    -.3361966   -.0860157
             1983  |  -.2009429   .0643793    -3.12   0.002     -.327124   -.0747618
             1984  |  -.1802155   .0643151    -2.80   0.005    -.3062709   -.0541602
             1985  |  -.1607361    .063853    -2.52   0.012    -.2858857   -.0355865
             1986  |  -.1239513   .0633388    -1.96   0.050    -.2480931    .0001906
             1987  |  -.0734707   .0636827    -1.15   0.249    -.1982866    .0513451
             1988  |  -.0612699   .0636384    -0.96   0.336    -.1859989    .0634592
             1989  |  -.0472791   .0646767    -0.73   0.465     -.174043    .0794848
             1990  |  -.0562684   .0648485    -0.87   0.386    -.1833691    .0708322
             1991  |  -.1008239   .0678457    -1.49   0.137     -.233799    .0321512
             1992  |  -.1281429   .0687666    -1.86   0.062     -.262923    .0066372
             1993  |  -.1179645   .0701162    -1.68   0.092    -.2553897    .0194607
             1994  |  -.1016004   .0704979    -1.44   0.150    -.2397737     .036573
             1995  |  -.0347759   .0690608    -0.50   0.615    -.1701326    .1005808
             1996  |   -.032539   .0640096    -0.51   0.611    -.1579956    .0929175
             1997  |  -.0008777   .0629773    -0.01   0.989     -.124311    .1225555
             1998  |   .1009128   .0654548     1.54   0.123    -.0273762    .2292019
             1999  |   .1961752   .0651975     3.01   0.003     .0683905    .3239599
             2000  |   .3592203   .0643746     5.58   0.000     .2330485    .4853922
             2001  |   .1807142   .0645993     2.80   0.005     .0541019    .3073266
             2002  |   .1244587   .0630441     1.97   0.048     .0008944    .2480229
             2003  |   .0556812   .0632003     0.88   0.378    -.0681891    .1795515
             2004  |  -.0192879   .0641448    -0.30   0.764    -.1450094    .1064337
             2005  |   .1434963   .0643798     2.23   0.026     .0173142    .2696783
             2006  |   .2255599   .0640417     3.52   0.000     .1000404    .3510794
             2007  |   .3341197   .0640196     5.22   0.000     .2086436    .4595959
             2008  |    .197919   .0657116     3.01   0.003     .0691266    .3267113
             2009  |   .0217415   .0676048     0.32   0.748    -.1107615    .1542445
                   |
           polity2 |   .0003807   .0010305     0.37   0.712     -.001639    .0024003
     cln_GDP2005US |    .067886   .0068885     9.86   0.000     .0543848    .0813871
 cln_GDP_pc2005USD |  -.0095782   .0100929    -0.95   0.343      -.02936    .0102036
        cGDPgrowth |  -.0003133   .0004838    -0.65   0.517    -.0012615     .000635
      cTradePctGDP |   .0009762   .0001373     7.11   0.000      .000707    .0012453
           ckaopen |  -.0014417   .0027609    -0.52   0.602     -.006853    .0039695
      cln_resource |  -.0218196   .0046695    -4.67   0.000    -.0309717   -.0126674
        cln_battle |   .0004805   .0009707     0.49   0.621    -.0014221     .002383
             _cons |   3.405163   .0139518   244.07   0.000     3.377818    3.432508
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1325585   .0082358      .1173608    .1497242
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   3.22e-06   .0018269             0           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .1490516   .0016674       .145819    .1523558
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1897.91               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(4,000 missing values generated)

.                 matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -3382.499           .  -3382.499  -3382.499

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,039 missing values generated)
(194 missing values generated)

.                 /* Figure R24 */        
>                 /* generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*polity2 + _b[1970b.year#clji] + REyear_yr if year==1970;
(8,024 missing values generated)

.                 gen MEslope_t=0;

.                         forvalues year=1971(1)2009  {;
  2.                                 replace MEslope_t = (_b[`year'.year#clji_democ])*polity2 + _b[`year'.year#clji] + REyear_yr if year==`year';
  3.                 };
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 67 to missing)
(201 real changes made, 67 to missing)
(201 real changes made, 67 to missing)
(201 real changes made, 66 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 68 to missing)
(201 real changes made, 67 to missing)
(201 real changes made, 66 to missing)
(201 real changes made, 67 to missing)
(197 real changes made, 46 to missing)
(197 real changes made, 45 to missing)
(196 real changes made, 41 to missing)
(196 real changes made, 41 to missing)
(196 real changes made, 42 to missing)
(196 real changes made, 42 to missing)
(196 real changes made, 42 to missing)
(196 real changes made, 42 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 42 to missing)
(197 real changes made, 41 to missing)
(197 real changes made, 42 to missing)
(195 real changes made, 39 to missing)
(195 real changes made, 39 to missing)

.                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 77 to missing)

.                                                         /* Plot slope over time */
>                         collapse MEslope_t, by(polity2 year time);

.                                         twoway connected MEslope_t year if year<2010 & polity2==(-10) & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mc
> olor(gs14) lcolor(gs14)
>                                 || connected MEslope_t year if year<2010 & polity2==(-9) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs13) lcolor(gs13)
>                                 || connected MEslope_t year if year<2010 & polity2==(-8) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs13) lcolor(gs13)
>                                 || connected MEslope_t year if year<2010 & polity2==(-7) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & polity2==(-6) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & polity2==(-5) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs11) lcolor(gs11)
>                                 || connected MEslope_t year if year<2010 & polity2==(-4) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & polity2==(-3) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs9) lcolor(gs9)
>                                 || connected MEslope_t year if year<2010 & polity2==(-2) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs9) lcolor(gs9)
>                                 || connected MEslope_t year if year<2010 & polity2==(-1) & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & polity2==0 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs7) lcolor(gs7)
>                                 || connected MEslope_t year if year<2010 & polity2==1 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs7) lcolor(gs7)
>                                 || connected MEslope_t year if year<2010 & polity2==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & polity2==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs5) lcolor(gs5)
>                                 || connected MEslope_t year if year<2010 & polity2==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs5) lcolor(gs5)
>                                 || connected MEslope_t year if year<2010 & polity2==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & polity2==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs3) lcolor(gs3)
>                                 || connected MEslope_t year if year<2010 & polity2==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2)
>                                 || connected MEslope_t year if year<2010 & polity2==8 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2)
>                                 || connected MEslope_t year if year<2010 & polity2==9 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs1) lcolor(gs1)
>                                 || connected MEslope_t year if year<2010 & polity2==10 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs0) lcolor(gs0)         
>            
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R24. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(LJI: 21-pt Democracy
>  Scale)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R24, replace;
(note: file Figure_R24.gph not found)
(file Figure_R24.gph saved)

.                                                                                         /* Sample: Using PCSE instead of MLM */
>         
>         /* Table R7 Model 1 */
>         /* Fixed model */
>         use `temp', clear;

.                 xtpcse ln_FDI_net_inflows cPRdemoc cefw2legalrights cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                  i.ccode, p het;

Number of gaps in sample:  406

Linear regression, heteroskedastic panels corrected standard errors

Group variable:   ccode                         Number of obs     =      1,533
Time variable:    year                          Number of groups  =        127
Panels:           heteroskedastic (unbalanced)  Obs per group:
Autocorrelation:  no autocorrelation                          min =          1
                                                              avg =  12.070866
                                                              max =         16
Estimated covariances      =       127          R-squared         =     0.6920
Estimated autocorrelations =         0          Wald chi2(136)    =    5482.76
Estimated coefficients     =       137          Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------
                  |            Het-corrected
ln_FDI_net_infl~s |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
         cPRdemoc |   .0045363   .0023418     1.94   0.053    -.0000536    .0091262
 cefw2legalrights |   -.009815   .0057283    -1.71   0.087    -.0210423    .0014123
          cxconst |  -.0057168   .0044179    -1.29   0.196    -.0143758    .0029422
    cln_GDP2005US |   .0479702   .0223091     2.15   0.032     .0042452    .0916951
cln_GDP_pc2005USD |   .2993031   .0390686     7.66   0.000     .2227301     .375876
       cGDPgrowth |   .0009234   .0008715     1.06   0.289    -.0007848    .0026316
     cTradePctGDP |   .0020551   .0003502     5.87   0.000     .0013687    .0027415
          ckaopen |   .0058192   .0059749     0.97   0.330    -.0058914    .0175299
     cln_resource |  -.0423727   .0119577    -3.54   0.000    -.0658093   -.0189361
       cln_battle |  -.0018832   .0017376    -1.08   0.278    -.0052887    .0015224
                  |
            ccode |
              20  |  -.8734176   .1955922    -4.47   0.000    -1.256771   -.4900639
              41  |  -.0550239   .2216579    -0.25   0.804    -.4894654    .3794176
              42  |  -.6330144   .1945652    -3.25   0.001    -1.014355   -.2516735
              51  |  -.6653182   .2130296    -3.12   0.002    -1.082849   -.2477878
              52  |  -.8576424   .2201441    -3.90   0.000    -1.289117   -.4261679
              70  |  -.5226396    .175664    -2.98   0.003    -.8669348   -.1783445
              90  |  -.5162836   .1985252    -2.60   0.009    -.9053859   -.1271813
              91  |  -.4494073   .2104234    -2.14   0.033    -.8618296   -.0369851
              92  |   -.607269   .2006638    -3.03   0.002    -1.000563   -.2139753
              93  |   -.316211   .2165705    -1.46   0.144    -.7406813    .1082593
              94  |  -.7630863   .2003513    -3.81   0.000    -1.155768   -.3704049
              95  |  -.9070782   .2084722    -4.35   0.000    -1.315676   -.4984801
             100  |  -.4552818   .1885323    -2.41   0.016    -.8247983   -.0857653
             101  |  -.7258051   .1877879    -3.87   0.000    -1.093863   -.3577475
             110  |  -.3615921   .2516621    -1.44   0.151    -.8548407    .1316565
             130  |  -.5331165   .2004766    -2.66   0.008    -.9260434   -.1401896
             135  |  -.4760277   .1937359    -2.46   0.014    -.8557431   -.0963124
             140  |  -.3586026   .1822729    -1.97   0.049     -.715851   -.0013542
             145  |  -.1401679   .2215116    -0.63   0.527    -.5743226    .2939868
             150  |  -.4569338    .209907    -2.18   0.029     -.868344   -.0455236
             155  |  -.6700892   .1865597    -3.59   0.000    -1.035739   -.3044389
             160  |  -.6756715   .1785734    -3.78   0.000    -1.025669    -.325674
             165  |   -.739764   .1991459    -3.71   0.000    -1.130083   -.3494451
             200  |  -.3944848    .224046    -1.76   0.078    -.8336069    .0446373
             205  |  -1.215857   .2135791    -5.69   0.000    -1.634464   -.7972492
             210  |  -.4917664   .2905639    -1.69   0.091    -1.061261    .0777283
             211  |  -.6520204   .2186493    -2.98   0.003    -1.080565   -.2234757
             220  |  -.7419407   .1871283    -3.96   0.000    -1.108705    -.375176
             225  |  -1.251538    .210705    -5.94   0.000    -1.664512   -.8385639
             230  |  -.7519031   .1806273    -4.16   0.000    -1.105926   -.3978802
             235  |  -1.104759    .178594    -6.19   0.000    -1.454796   -.7547207
             255  |  -.8946269   .2309702    -3.87   0.000     -1.34732   -.4419336
             290  |  -.7218333    .174196    -4.14   0.000    -1.063251   -.3804154
             305  |  -1.259571   .2028269    -6.21   0.000    -1.657104   -.8620372
             310  |  -.8325172   .2115099    -3.94   0.000    -1.247069   -.4179654
             316  |  -1.113465   .1879962    -5.92   0.000     -1.48193   -.7449987
             317  |  -1.215008    .196854    -6.17   0.000    -1.600835   -.8291815
             325  |  -1.128413   .1745536    -6.46   0.000    -1.470531   -.7862937
             339  |  -.5041335   .2086042    -2.42   0.016    -.9129901   -.0952768
             343  |  -.6482448   .2144082    -3.02   0.002    -1.068477   -.2280125
             344  |  -.9769068   .1917384    -5.09   0.000    -1.352707   -.6011064
             349  |   -1.30807   .2006327    -6.52   0.000    -1.701302   -.9148367
             350  |  -1.223329   .1770592    -6.91   0.000    -1.570359   -.8762997
             352  |  -1.279734   .2065923    -6.19   0.000    -1.684647   -.8748202
             355  |  -.6698731   .1964062    -3.41   0.001    -1.054822    -.284924
             359  |  -.3211796   .2224917    -1.44   0.149    -.7572554    .1148962
             360  |  -.6448569   .1851875    -3.48   0.000    -1.007818    -.281896
             365  |  -.3173755   .1912795    -1.66   0.097    -.6922765    .0575255
             366  |  -1.132815   .2124724    -5.33   0.000    -1.549253   -.7163766
             367  |  -.9481616   .2041712    -4.64   0.000     -1.34833   -.5479935
             368  |  -1.001132   .2012186    -4.98   0.000    -1.395513    -.606751
             369  |  -.4254562   .1935595    -2.20   0.028    -.8048258   -.0460867
             371  |  -.4153947   .2148673    -1.93   0.053    -.8365269    .0057376
             372  |  -.4084499   .2130186    -1.92   0.055    -.8259587    .0090588
             373  |  -.3672585   .2146908    -1.71   0.087    -.7880446    .0535277
             375  |  -1.331758   .1871668    -7.12   0.000    -1.698598   -.9649175
             380  |  -1.208206   .1843241    -6.55   0.000    -1.569475   -.8469378
             385  |  -1.384169   .1886242    -7.34   0.000    -1.753866   -1.014473
             390  |  -1.407123   .1957999    -7.19   0.000    -1.790883   -1.023362
             404  |   .0514922   .2387199     0.22   0.829    -.4163902    .5193745
             432  |   .0697389   .2250583     0.31   0.757    -.3713674    .5108451
             433  |  -.1766913   .2123404    -0.83   0.405    -.5928708    .2394882
             434  |  -.0433382   .2171488    -0.20   0.842     -.468942    .3822656
             435  |  -.1194682   .2345242    -0.51   0.610    -.5791271    .3401908
             436  |   .1936048   .2298311     0.84   0.400    -.2568559    .6440654
             437  |   -.317374   .2036196    -1.56   0.119     -.716461    .0817131
             439  |   .0317687   .2161115     0.15   0.883    -.3918021    .4553394
             451  |   .1628596    .232535     0.70   0.484    -.2929007    .6186199
             452  |   -.014779   .2191138    -0.07   0.946    -.4442341    .4146762
             461  |  -.0302445   .2264164    -0.13   0.894    -.4740124    .4135234
             471  |  -.1839481   .2075076    -0.89   0.375    -.5906555    .2227594
             475  |  -.0838856   .2093763    -0.40   0.689    -.4942556    .3264845
             481  |  -.8016561   .2146828    -3.73   0.000    -1.222427   -.3808856
             482  |   .1385088   .2309948     0.60   0.549    -.3142326    .5912503
             483  |  -.0424289   .2268491    -0.19   0.852    -.4870449    .4021871
             484  |  -.4374218   .2222127    -1.97   0.049    -.8729507   -.0018929
             490  |  -.0795606   .2106552    -0.38   0.706    -.4924372     .333316
             500  |   .1090165    .227983     0.48   0.633     -.337822    .5558551
             501  |   -.110824     .21133    -0.52   0.600    -.5250231    .3033751
             510  |   .0221671   .2136992     0.10   0.917    -.3966756    .4410098
             516  |   .3840975   .2462375     1.56   0.119    -.0985191    .8667142
             517  |   .1728404   .2282191     0.76   0.449    -.2744609    .6201416
             530  |   .2373836   .2292637     1.04   0.300    -.2119649    .6867322
             540  |  -.6264368   .2048804    -3.06   0.002    -1.027995   -.2248786
             541  |   .0405305   .2220261     0.18   0.855    -.3946327    .4756937
             551  |  -.1050705   .2212433    -0.47   0.635    -.5386994    .3285584
             552  |  -.0833787   .2163062    -0.39   0.700    -.5073311    .3405737
             553  |   .2217634   .2330464     0.95   0.341    -.2349991    .6785259
             560  |  -.7576113   .1765858    -4.29   0.000    -1.103713   -.4115094
             565  |  -.6498871   .2081847    -3.12   0.002    -1.057922   -.2418527
             570  |  -.3048474   .2338233    -1.30   0.192    -.7631327    .1534379
             571  |  -.7489683   .2100263    -3.57   0.000    -1.160612   -.3373243
             580  |   .1129369   .2254448     0.50   0.616    -.3289269    .5548006
             590  |  -.8290636   .2175987    -3.81   0.000    -1.255549   -.4025781
             600  |   -.451621   .1917517    -2.36   0.019    -.8274474   -.0757946
             615  |  -.5297917   .1935388    -2.74   0.006    -.9091209   -.1504626
             616  |  -.6048922   .1970181    -3.07   0.002    -.9910405   -.2187439
             630  |   -.530644   .1893223    -2.80   0.005    -.9017089   -.1595792
             640  |  -.7357346   .1752673    -4.20   0.000    -1.079252    -.392217
             651  |  -.2137763   .2034674    -1.05   0.293    -.6125651    .1850124
             652  |   -.323509   .2034173    -1.59   0.112    -.7221997    .0751816
             663  |  -.6268958   .2078999    -3.02   0.003    -1.034372   -.2194195
             666  |  -1.147628   .1878728    -6.11   0.000    -1.515852   -.7794044
             690  |  -1.303452   .2035425    -6.40   0.000    -1.702388   -.9045159
             692  |  -1.220807   .2259886    -5.40   0.000    -1.663737   -.7778777
             696  |  -1.463811   .2068543    -7.08   0.000    -1.869238   -1.058384
             698  |  -.9680532   .2081507    -4.65   0.000    -1.376021   -.5600854
             705  |  -.5073982   .1940748    -2.61   0.009    -.8877778   -.1270185
             710  |   .5797412   .2068088     2.80   0.005     .1744034    .9850791
             712  |  -.2549684   .2360517    -1.08   0.280    -.7176213    .2076845
             732  |  -1.107512   .1691691    -6.55   0.000    -1.439077   -.7759467
             740  |  -1.346733   .1655431    -8.14   0.000    -1.671191   -1.022275
             750  |   .0886531    .212176     0.42   0.676    -.3272042    .5045105
             770  |  -.0819072   .2062627    -0.40   0.691    -.4861746    .3223602
             771  |  -.0239963   .2101033    -0.11   0.909    -.4357912    .3877985
             780  |  -.3391104   .2056023    -1.65   0.099    -.7420835    .0638627
             790  |   .0918312   .2216338     0.41   0.679     -.342563    .5262254
             800  |  -.5342578   .1920061    -2.78   0.005    -.9105827   -.1579328
             820  |   -.821984   .2003267    -4.10   0.000    -1.214617   -.4293509
             830  |  -1.600783   .2470847    -6.48   0.000     -2.08506   -1.116506
             840  |  -.3729891   .1978573    -1.89   0.059    -.7607823    .0148041
             850  |    -.32472   .2014872    -1.61   0.107    -.7196276    .0701876
             900  |  -1.074517   .2396635    -4.48   0.000    -1.544249   -.6047855
             910  |  -.1546844   .2314549    -0.67   0.504    -.6083277    .2989588
             920  |  -1.246106   .1876713    -6.64   0.000    -1.613935   -.8782772
             950  |  -.6903054   .2198681    -3.14   0.002    -1.121239   -.2593719
                  |
            _cons |   3.967137   .2004207    19.79   0.000      3.57432    4.359955
-----------------------------------------------------------------------------------

.                                         /* Figure R25 */
>                         /* Marginal effects */
>                         grinter cefw2legalrights, inter(cPRdemoc) con(cxconst) scheme(s1mono) yline(0, lpattern(dot) lcolor(gs8)) kdensity nomean clevel(90)
>                                 title(Figure R25. Marginal Effects of Property Rights on FDI.);

.                                         graph save Figure_R25, replace;
(note: file Figure_R25.gph not found)
(file Figure_R25.gph saved)

.                 /* Table R7 Model 2 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtpcse ln_FDI_net_inflows c.cPRdemoc#year c.cefw2legalrights#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_ba
> ttle
>                 i.ccode, p het;

Number of gaps in sample:  406

Linear regression, heteroskedastic panels corrected standard errors

Group variable:   ccode                         Number of obs     =      1,533
Time variable:    year                          Number of groups  =        127
Panels:           heteroskedastic (unbalanced)  Obs per group:
Autocorrelation:  no autocorrelation                          min =          1
                                                              avg =  12.070866
                                                              max =         16
Estimated covariances      =       127          R-squared         =     0.7556
Estimated autocorrelations =         0          Wald chi2(166)    =    5402.49
Estimated coefficients     =       167          Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------------
                        |            Het-corrected
     ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        year#c.cPRdemoc |
                  1970  |  -.0048184   .0104056    -0.46   0.643    -.0252131    .0155763
                  1975  |  -.0111424   .0068878    -1.62   0.106    -.0246422    .0023574
                  1980  |  -.0062455   .0065719    -0.95   0.342    -.0191261    .0066352
                  1985  |  -.0081542   .0058672    -1.39   0.165    -.0196537    .0033453
                  1990  |  -.0010844   .0047519    -0.23   0.819     -.010398    .0082292
                  1995  |  -.0038058   .0062981    -0.60   0.546    -.0161497    .0085382
                  2000  |   .0293438   .0059431     4.94   0.000     .0176956    .0409919
                  2001  |   .0063168   .0059289     1.07   0.287    -.0053036    .0179372
                  2002  |   .0028899   .0058863     0.49   0.623     -.008647    .0144267
                  2003  |  -.0040574   .0054905    -0.74   0.460    -.0148186    .0067039
                  2004  |  -.0138679   .0055637    -2.49   0.013    -.0247725   -.0029633
                  2005  |    .009023   .0061079     1.48   0.140    -.0029483    .0209944
                  2006  |   .0187152    .006341     2.95   0.003      .006287    .0311434
                  2007  |   .0320007   .0059867     5.35   0.000      .020267    .0437345
                  2008  |    .019917   .0064378     3.09   0.002     .0072992    .0325349
                  2009  |  -.0010708   .0069631    -0.15   0.878    -.0147182    .0125767
                        |
year#c.cefw2legalrights |
                  1970  |  -.0503976   .0304899    -1.65   0.098    -.1101567    .0093615
                  1975  |  -.0482882   .0172239    -2.80   0.005    -.0820465   -.0145299
                  1980  |  -.0445644   .0171683    -2.60   0.009    -.0782137   -.0109152
                  1985  |  -.0564839   .0140021    -4.03   0.000    -.0839274   -.0290404
                  1990  |    -.03038   .0103553    -2.93   0.003    -.0506761    -.010084
                  1995  |  -.0158179   .0113529    -1.39   0.164    -.0380691    .0064333
                  2000  |   .0377773   .0094498     4.00   0.000     .0192561    .0562985
                  2001  |   .0168812   .0087709     1.92   0.054    -.0003095    .0340718
                  2002  |   .0075272   .0081469     0.92   0.356    -.0084404    .0234947
                  2003  |   .0023704   .0078678     0.30   0.763    -.0130503    .0177911
                  2004  |  -.0040493   .0075252    -0.54   0.591    -.0187984    .0106997
                  2005  |   .0209139   .0095487     2.19   0.029     .0021988    .0396291
                  2006  |   .0435988   .0096515     4.52   0.000     .0246821    .0625155
                  2007  |   .0660935   .0102918     6.42   0.000     .0459219     .086265
                  2008  |   .0319721   .0107808     2.97   0.003     .0108421    .0531021
                  2009  |   .0188146   .0100654     1.87   0.062    -.0009133    .0385424
                        |
                cxconst |  -.0028629   .0039561    -0.72   0.469    -.0106168    .0048909
          cln_GDP2005US |   .1434463    .027103     5.29   0.000     .0903255    .1965672
      cln_GDP_pc2005USD |   .0798257   .0405414     1.97   0.049     .0003659    .1592855
             cGDPgrowth |    .000994   .0007358     1.35   0.177    -.0004481    .0024361
           cTradePctGDP |   .0015686   .0003006     5.22   0.000     .0009795    .0021578
                ckaopen |   .0049642   .0054604     0.91   0.363     -.005738    .0156664
           cln_resource |  -.0389961   .0101392    -3.85   0.000    -.0588686   -.0191235
             cln_battle |   .0000739   .0016781     0.04   0.965     -.003215    .0033629
                        |
                  ccode |
                    20  |  -.6897885   .1468736    -4.70   0.000    -.9776555   -.4019215
                    41  |   -.081586   .1883627    -0.43   0.665    -.4507701    .2875981
                    42  |  -.5248102   .1625494    -3.23   0.001    -.8434012   -.2062191
                    51  |  -.5001117   .1827445    -2.74   0.006    -.8582844    -.141939
                    52  |  -.4595181   .1991504    -2.31   0.021    -.8498458   -.0691905
                    70  |  -.5738615   .1384743    -4.14   0.000    -.8452661   -.3024569
                    90  |  -.5079347   .1637491    -3.10   0.002     -.828877   -.1869923
                    91  |  -.4021495   .1762231    -2.28   0.022    -.7475404   -.0567586
                    92  |  -.5093074     .16888    -3.02   0.003    -.8403062   -.1783086
                    93  |   -.279958   .1839875    -1.52   0.128    -.6405669    .0806509
                    94  |  -.6107172   .1742144    -3.51   0.000    -.9521712   -.2692632
                    95  |  -.6478761   .1837432    -3.53   0.000    -1.008006    -.287746
                   100  |  -.5716932   .1491528    -3.83   0.000    -.8640274    -.279359
                   101  |  -.6469553   .1516309    -4.27   0.000    -.9441464   -.3497642
                   110  |  -.1522136   .2246975    -0.68   0.498    -.5926126    .2881855
                   130  |  -.4736046   .1652946    -2.87   0.004     -.797576   -.1496332
                   135  |  -.5667659   .1537831    -3.69   0.000    -.8681753   -.2653565
                   140  |  -.5395473   .1443347    -3.74   0.000    -.8224381   -.2566565
                   145  |  -.1858621   .1838157    -1.01   0.312    -.5461343    .1744102
                   150  |  -.3490116   .1817788    -1.92   0.055    -.7052915    .0072684
                   155  |   -.615631   .1520269    -4.05   0.000    -.9135983   -.3176637
                   160  |  -.6861198   .1411032    -4.86   0.000     -.962677   -.4095625
                   165  |  -.5270849   .1736381    -3.04   0.002    -.8674093   -.1867605
                   200  |  -.2670604   .1770537    -1.51   0.131    -.6140793    .0799585
                   205  |   -.782373   .1884003    -4.15   0.000    -1.151631   -.4131152
                   210  |  -.2106896   .2385193    -0.88   0.377    -.6781789    .2567997
                   211  |  -.3091568   .1897832    -1.63   0.103     -.681125    .0628114
                   220  |  -.6151413   .1505765    -4.09   0.000    -.9102659   -.3200167
                   225  |   -.956886   .1814198    -5.27   0.000    -1.312462   -.6013098
                   230  |  -.6204687   .1450626    -4.28   0.000    -.9047861   -.3361513
                   235  |  -.8759784   .1520977    -5.76   0.000    -1.174084   -.5778724
                   255  |  -.8108487   .1819874    -4.46   0.000    -1.167537   -.4541599
                   290  |  -.6996804   .1376764    -5.08   0.000    -.9695212   -.4298396
                   305  |  -.9429475   .1762203    -5.35   0.000    -1.288333    -.597562
                   310  |  -.6473456   .1833447    -3.53   0.000    -1.006695   -.2879966
                   316  |  -.8899646   .1592935    -5.59   0.000    -1.202174    -.577755
                   317  |  -.9361888   .1717808    -5.45   0.000    -1.272873   -.5995046
                   325  |  -.9985413   .1413763    -7.06   0.000    -1.275634   -.7214488
                   339  |  -.3407863   .1798922    -1.89   0.058    -.6933686     .011796
                   343  |  -.3989137   .1936418    -2.06   0.039    -.7784447   -.0193827
                   344  |  -.7091663   .1675188    -4.23   0.000    -1.037497   -.3808356
                   349  |  -.8835095   .1833778    -4.82   0.000    -1.242923   -.5240957
                   350  |  -.9707508   .1499694    -6.47   0.000    -1.264685   -.6768161
                   352  |  -.8028144   .1965256    -4.09   0.000    -1.187997   -.4176314
                   355  |  -.5454851   .1657767    -3.29   0.001    -.8704014   -.2205688
                   359  |  -.3212682   .1891517    -1.70   0.089    -.6919988    .0494623
                   360  |  -.6295158   .1485894    -4.24   0.000    -.9207457    -.338286
                   365  |  -.4770036   .1527636    -3.12   0.002    -.7764147   -.1775925
                   366  |  -.7743009    .196601    -3.94   0.000    -1.159632   -.3889701
                   367  |  -.6880741   .1832176    -3.76   0.000    -1.047174   -.3289742
                   368  |  -.7690587   .1788183    -4.30   0.000    -1.119536   -.4185813
                   369  |  -.5565895   .1531128    -3.64   0.000    -.8566851    -.256494
                   371  |  -.3115691    .184325    -1.69   0.091    -.6728394    .0497012
                   372  |  -.3353976   .1808303    -1.85   0.064    -.6898184    .0190232
                   373  |  -.3306534   .1754256    -1.88   0.059    -.6744813    .0131745
                   375  |  -.9970805   .1674225    -5.96   0.000    -1.325222   -.6689385
                   380  |  -.8979222   .1544899    -5.81   0.000    -1.200717   -.5951276
                   385  |  -.9617048   .1681234    -5.72   0.000     -1.29122    -.632189
                   390  |  -1.022423   .1727059    -5.92   0.000     -1.36092   -.6839251
                   404  |   .1090975   .2094354     0.52   0.602    -.3013883    .5195834
                   432  |   -.121738   .1811698    -0.67   0.502    -.4768243    .2333484
                   433  |  -.2594618   .1731806    -1.50   0.134    -.5988894    .0799659
                   434  |  -.1323743   .1778456    -0.74   0.457    -.4809453    .2161968
                   435  |  -.0875616    .197545    -0.44   0.658    -.4747427    .2996194
                   436  |  -.0477019   .1845133    -0.26   0.796    -.4093412    .3139375
                   437  |  -.3824343   .1656583    -2.31   0.021    -.7071187   -.0577499
                   439  |   -.145747   .1727023    -0.84   0.399    -.4842373    .1927432
                   451  |    .071778   .1923714     0.37   0.709    -.3052631    .4488191
                   452  |  -.2549406   .1738369    -1.47   0.142    -.5956546    .0857734
                   461  |  -.0981078   .1878069    -0.52   0.601    -.4662025    .2699869
                   471  |  -.2946213   .1657599    -1.78   0.076    -.6195047     .030262
                   475  |  -.4204416   .1644559    -2.56   0.011    -.7427692    -.098114
                   481  |  -.4103285   .1945743    -2.11   0.035    -.7916871   -.0289698
                   482  |   .0724539    .192258     0.38   0.706     -.304365    .4492727
                   483  |   -.151881   .1832858    -0.83   0.407    -.5111145    .2073526
                   484  |  -.2798645   .1904245    -1.47   0.142    -.6530897    .0933607
                   490  |   -.346369   .1667849    -2.08   0.038    -.6732614   -.0194766
                   500  |  -.2105053   .1797205    -1.17   0.241    -.5627511    .1417404
                   501  |  -.3587078   .1676504    -2.14   0.032    -.6872966   -.0301189
                   510  |  -.3051856   .1672899    -1.82   0.068    -.6330677    .0226966
                   516  |   .1712991   .2013239     0.85   0.395    -.2232886    .5658868
                   517  |  -.0215104   .1834776    -0.12   0.907    -.3811199     .338099
                   530  |  -.2530105   .1788077    -1.41   0.157    -.6034671    .0974462
                   540  |  -.5921375   .1653095    -3.58   0.000    -.9161382   -.2681369
                   541  |  -.1703617   .1770392    -0.96   0.336    -.5173522    .1766288
                   551  |  -.2432786   .1793873    -1.36   0.175    -.5948714    .1083141
                   552  |  -.2259825   .1746308    -1.29   0.196    -.5682525    .1162876
                   553  |  -.0535219   .1865431    -0.29   0.774    -.4191397    .3120959
                   560  |  -.8031549   .1395881    -5.75   0.000    -1.076743   -.5295672
                   565  |   -.484493    .182794    -2.65   0.008    -.8427627   -.1262232
                   570  |  -.1473575   .2062469    -0.71   0.475     -.551594     .256879
                   571  |  -.5072826    .188615    -2.69   0.007    -.8769613    -.137604
                   580  |  -.1204719   .1812563    -0.66   0.506    -.4757278    .2347839
                   590  |  -.5139347   .1991594    -2.58   0.010      -.90428   -.1235895
                   600  |  -.5775324   .1513465    -3.82   0.000    -.8741662   -.2808986
                   615  |  -.5778045    .152655    -3.79   0.000    -.8770028   -.2786061
                   616  |  -.5572551   .1621775    -3.44   0.001    -.8751173    -.239393
                   630  |  -.6809932   .1459684    -4.67   0.000    -.9670859   -.3949005
                   640  |  -.8247259   .1362191    -6.05   0.000     -1.09171   -.5577414
                   651  |  -.4750918    .158664    -2.99   0.003    -.7860675   -.1641161
                   652  |  -.3965886   .1622105    -2.44   0.014    -.7145153   -.0786619
                   663  |  -.5200163   .1767138    -2.94   0.003    -.8663689   -.1736636
                   666  |  -.8555097   .1637884    -5.22   0.000    -1.176529   -.5344903
                   690  |  -.8381774   .1840962    -4.55   0.000    -1.198999   -.4773555
                   692  |  -.6534286   .2116947    -3.09   0.002    -1.068343   -.2385145
                   696  |  -.9484293   .1827219    -5.19   0.000    -1.306558   -.5903009
                   698  |  -.6081666   .1847768    -3.29   0.001    -.9703225   -.2460106
                   705  |  -.4521125    .157481    -2.87   0.004    -.7607695   -.1434555
                   710  |   .0591353   .1816087     0.33   0.745    -.2968111    .4150817
                   712  |  -.2162891   .2033262    -1.06   0.287    -.6148012    .1822229
                   732  |  -1.049696   .1338597    -7.84   0.000    -1.312056   -.7873357
                   740  |  -1.306594   .1306103   -10.00   0.000    -1.562585   -1.050603
                   750  |  -.5799956   .1742321    -3.33   0.001    -.9214842   -.2385071
                   770  |   -.493048   .1588276    -3.10   0.002    -.8043445   -.1817515
                   771  |  -.4353764   .1639352    -2.66   0.008    -.7566835   -.1140692
                   780  |  -.4862983   .1630032    -2.98   0.003    -.8057787   -.1668179
                   790  |  -.1568114   .1754502    -0.89   0.371    -.5006874    .1870647
                   800  |  -.6987766   .1495647    -4.67   0.000     -.991918   -.4056352
                   820  |  -.7682006    .163135    -4.71   0.000    -1.087939   -.4484619
                   830  |   -1.09064   .2182457    -5.00   0.000    -1.518394   -.6628866
                   840  |  -.6291742   .1550288    -4.06   0.000     -.933025   -.3253233
                   850  |  -.6470339   .1587439    -4.08   0.000    -.9581662   -.3359015
                   900  |  -.8809556   .2232499    -3.95   0.000    -1.318517   -.4433938
                   910  |  -.1571292   .1925618    -0.82   0.415    -.5345433    .2202849
                   920  |  -.9253481   .1773019    -5.22   0.000    -1.272853   -.5778428
                   950  |  -.3578593     .20192    -1.77   0.076    -.7536153    .0378967
                        |
                  _cons |    3.84143   .1702059    22.57   0.000     3.507833    4.175028
-----------------------------------------------------------------------------------------

.                 gen time= 1 if e(sample)==1;
(6,615 missing values generated)

.                 /* Figure R26 */
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#cPRdemoc])*cxconst + _b[1970b.year#cefw2legalrights] if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                 #delimit;
delimiter now ;
.                         forvalues year=1975(5)2000  {;
  2.                                                 replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] if year==`year';
  3.                         };
(201 real changes made, 71 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 72 to missing)
(196 real changes made, 49 to missing)
(197 real changes made, 50 to missing)

.                                                 forvalues year=2001/2009  {;
  2.                                         replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] if year==`year';
  3.                         };
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                         /* Plot slope over time */
>                         collapse MEslope_t, by(xconst year time);

.                                 twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lc
> olor(gs14)
>                                 || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R26. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(Panel Corrected Stan
> dard Errors)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R26, replace;
(note: file Figure_R26.gph not found)
(file Figure_R26.gph saved)

.                                                 /* Table R7 Model 3 */                          
>         /* lji */
>         /* Fixed model */
>         use `temp', clear;

.                 xtpcse ln_FDI_net_inflows clji_democ clji cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                  i.ccode, p het;

Number of gaps in sample:  62

Linear regression, heteroskedastic panels corrected standard errors

Group variable:   ccode                         Number of obs     =      4,148
Time variable:    year                          Number of groups  =        149
Panels:           heteroskedastic (unbalanced)  Obs per group:
Autocorrelation:  no autocorrelation                          min =          1
                                                              avg =  27.838926
                                                              max =         40
Estimated covariances      =       149          R-squared         =     0.6071
Estimated autocorrelations =         0          Wald chi2(158)    =   61399.05
Estimated coefficients     =       159          Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------
                  |            Het-corrected
ln_FDI_net_infl~s |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
       clji_democ |   .0430323   .0061728     6.97   0.000     .0309339    .0551308
             clji |  -.0005873   .0389463    -0.02   0.988    -.0769206     .075746
          cxconst |  -.0016241   .0025429    -0.64   0.523     -.006608    .0033598
    cln_GDP2005US |   .0724463   .0086575     8.37   0.000      .055478    .0894147
cln_GDP_pc2005USD |    .086502   .0151669     5.70   0.000     .0567753    .1162287
       cGDPgrowth |  -.0007193   .0003751    -1.92   0.055    -.0014545    .0000158
     cTradePctGDP |   .0013598   .0001394     9.75   0.000     .0010866    .0016331
          ckaopen |   .0140988   .0025933     5.44   0.000     .0090159    .0191816
     cln_resource |  -.0265992   .0055017    -4.83   0.000    -.0373823   -.0158161
       cln_battle |   .0000279   .0007031     0.04   0.968    -.0013501    .0014059
                  |
            ccode |
              20  |  -.6066759   .1225576    -4.95   0.000    -.8468845   -.3664674
              41  |  -.2597196   .1271716    -2.04   0.041    -.5089713   -.0104679
              42  |  -.4433643   .1199166    -3.70   0.000    -.6783965   -.2083321
              51  |  -.4869526   .1224246    -3.98   0.000    -.7269004   -.2470047
              52  |  -.5189466   .1237603    -4.19   0.000    -.7615124   -.2763808
              70  |  -.4591391   .1165798    -3.94   0.000    -.6876312   -.2306469
              90  |  -.4580006   .1197127    -3.83   0.000    -.6926332   -.2233679
              91  |  -.3727901   .1236043    -3.02   0.003      -.61505   -.1305302
              92  |  -.4636549   .1205802    -3.85   0.000    -.6999877    -.227322
              93  |  -.3769404   .1234327    -3.05   0.002     -.618864   -.1350168
              94  |  -.5507654   .1199857    -4.59   0.000    -.7859329   -.3155978
              95  |  -.6442477   .1228275    -5.25   0.000    -.8849852   -.4035102
             100  |  -.4446515   .1172137    -3.79   0.000    -.6743861   -.2149169
             101  |  -.5638946   .1175275    -4.80   0.000    -.7942442    -.333545
             110  |  -.2851835   .1340717    -2.13   0.033    -.5479592   -.0224078
             130  |  -.4615163   .1199789    -3.85   0.000    -.6966706   -.2263619
             135  |  -.4663136   .1181441    -3.95   0.000    -.6978719   -.2347554
             140  |  -.4094405   .1205239    -3.40   0.001    -.6456631    -.173218
             145  |  -.2920507   .1247573    -2.34   0.019    -.5365705   -.0475309
             150  |  -.3818568   .1229694    -3.11   0.002    -.6228724   -.1408412
             155  |  -.4940166   .1165919    -4.24   0.000    -.7225325   -.2655007
             160  |  -.5460377   .1153797    -4.73   0.000    -.7721777   -.3198978
             165  |  -.5355461    .119064    -4.50   0.000    -.7689072   -.3021851
             200  |  -.2431849   .1385575    -1.76   0.079    -.5147526    .0283828
             205  |  -.7279961   .1257836    -5.79   0.000    -.9745274   -.4814649
             210  |  -.4227538   .1667809    -2.53   0.011    -.7496384   -.0958691
             211  |   -.078386   .1679657    -0.47   0.641    -.4075926    .2508206
             220  |  -.4999995   .1245699    -4.01   0.000    -.7441519    -.255847
             225  |  -.6825703   .1407665    -4.85   0.000    -.9584675   -.4066731
             230  |   -.540074   .1193282    -4.53   0.000     -.773953    -.306195
             235  |  -.7466266   .1143474    -6.53   0.000    -.9707434   -.5225098
             255  |  -.5125913   .1761582    -2.91   0.004     -.857855   -.1673275
             290  |  -.5228274   .1150142    -4.55   0.000     -.748251   -.2974038
             305  |  -.8408125   .1199222    -7.01   0.000    -1.075856   -.6057693
             310  |  -.5511965   .1303133    -4.23   0.000    -.8066058   -.2957872
             316  |  -.7231188   .1182822    -6.11   0.000    -.9549476   -.4912899
             317  |  -.7656633    .119916    -6.38   0.000    -1.000694   -.5306323
             325  |  -.8252881   .1148604    -7.19   0.000     -1.05041   -.6001658
             339  |  -.3727017   .1230958    -3.03   0.002    -.6139649   -.1314384
             343  |  -.4733951   .1227347    -3.86   0.000    -.7139507   -.2328395
             344  |  -.6364335   .1178001    -5.40   0.000    -.8673176   -.4055495
             349  |  -.8247782   .1195351    -6.90   0.000    -1.059063   -.5904938
             350  |  -.7734283   .1146515    -6.75   0.000    -.9981411   -.5487156
             352  |  -.7069472   .1219982    -5.79   0.000    -.9460593    -.467835
             355  |  -.5184697   .1195077    -4.34   0.000    -.7527006   -.2842388
             359  |   -.336118   .1265886    -2.66   0.008    -.5842271    -.088009
             360  |  -.5109314   .1169356    -4.37   0.000    -.7401211   -.2817418
             365  |   -.308547    .131431    -2.35   0.019     -.566147   -.0509469
             366  |  -.7320659   .1225501    -5.97   0.000    -.9722596   -.4918722
             367  |   -.633478   .1210512    -5.23   0.000    -.8707339   -.3962221
             368  |  -.6891562   .1197828    -5.75   0.000    -.9239262   -.4543862
             369  |  -.4482444   .1200745    -3.73   0.000    -.6835861   -.2129027
             370  |  -.5801871   .1200051    -4.83   0.000    -.8153927   -.3449814
             371  |  -.3381923    .125409    -2.70   0.007    -.5839893   -.0923952
             372  |  -.3506426    .124498    -2.82   0.005    -.5946542   -.1066311
             373  |  -.2831019   .1261825    -2.24   0.025    -.5304151   -.0357887
             375  |  -.8459271   .1165839    -7.26   0.000    -1.074427   -.6174269
             380  |  -.7708474   .1202145    -6.41   0.000    -1.006463   -.5352313
             385  |  -.8396609   .1168646    -7.18   0.000    -1.068711   -.6106105
             390  |  -.8696929   .1190267    -7.31   0.000    -1.102981   -.6364048
             402  |  -.2007543   .1314942    -1.53   0.127    -.4584782    .0569696
             404  |  -.0889718   .1301265    -0.68   0.494    -.3440151    .1660715
             411  |  -.3620247   .1397612    -2.59   0.010    -.6359517   -.0880977
             420  |  -.1528845   .1326696    -1.15   0.249    -.4129121    .1071432
             432  |  -.1927648    .126717    -1.52   0.128    -.4411257     .055596
             433  |  -.2981215   .1235592    -2.41   0.016     -.540293   -.0559499
             434  |  -.2111681   .1251763    -1.69   0.092    -.4565091    .0341729
             435  |  -.1878415   .1295516    -1.45   0.147    -.4417581     .066075
             436  |   -.164383   .1270309    -1.29   0.196     -.413359     .084593
             437  |  -.4400561   .1203675    -3.66   0.000     -.675972   -.2041402
             438  |  -.1048529   .1297292    -0.81   0.419    -.3591174    .1494117
             439  |  -.1836212    .125724    -1.46   0.144    -.4300357    .0627933
             450  |  -.2177298   .1335249    -1.63   0.103    -.4794337    .0439741
             451  |  -.1059968   .1286741    -0.82   0.410    -.3581934    .1461997
             452  |  -.2373415   .1250215    -1.90   0.058     -.482379    .0076961
             461  |  -.2272448    .127641    -1.78   0.075    -.4774167     .022927
             471  |  -.3265154   .1221331    -2.67   0.008    -.5658919   -.0871389
             475  |  -.3258393   .1232933    -2.64   0.008    -.5674898   -.0841888
             481  |  -.5080502   .1240419    -4.10   0.000    -.7511678   -.2649326
             482  |  -.1310078   .1284042    -1.02   0.308    -.3826755    .1206598
             483  |  -.2393933   .1267648    -1.89   0.059    -.4878477    .0090611
             484  |  -.3421899   .1269208    -2.70   0.007    -.5909502   -.0934296
             490  |  -.3454472   .1223225    -2.82   0.005    -.5851949   -.1056995
             500  |  -.2113803   .1272994    -1.66   0.097    -.4608825    .0381218
             501  |  -.3216225   .1229169    -2.62   0.009    -.5625353   -.0807097
             510  |  -.2678942   .1235651    -2.17   0.030    -.5100772   -.0257111
             516  |  -.0491572   .1312053    -0.37   0.708    -.3063149    .2080004
             517  |  -.1055983   .1282519    -0.82   0.410    -.3569675    .1457709
             522  |   -.280204   .1306061    -2.15   0.032    -.5361873   -.0242207
             530  |   -.163137   .1283358    -1.27   0.204    -.4146706    .0883966
             531  |  -.1156507    .129869    -0.89   0.373    -.3701893     .138888
             540  |   -.544932   .1225832    -4.45   0.000    -.7851906   -.3046733
             541  |  -.1656123   .1276397    -1.30   0.194    -.4157815     .084557
             551  |  -.2881276   .1248907    -2.31   0.021    -.5329089   -.0433463
             552  |  -.2734898   .1239807    -2.21   0.027    -.5164875   -.0304921
             553  |  -.1329363   .1285702    -1.03   0.301    -.3849293    .1190566
             560  |  -.6648033   .1142249    -5.82   0.000    -.8886799   -.4409267
             565  |  -.4618484   .1220349    -3.78   0.000    -.7010323   -.2226645
             570  |  -.2737886   .1307999    -2.09   0.036    -.5301518   -.0174254
             571  |  -.4690573   .1244032    -3.77   0.000    -.7128831   -.2252314
             572  |  -.4151483   .1280502    -3.24   0.001     -.666122   -.1641746
             580  |  -.1853474   .1258829    -1.47   0.141    -.4320735    .0613786
             581  |  -.0756216   .1313901    -0.58   0.565    -.3331415    .1818983
             590  |  -.5232803   .1251501    -4.18   0.000      -.76857   -.2779906
             600  |  -.4552344   .1187695    -3.83   0.000    -.6880185   -.2224504
             615  |  -.4951009   .1188023    -4.17   0.000    -.7279491   -.2622527
             616  |  -.4748802   .1202051    -3.95   0.000    -.7104779   -.2392824
             620  |  -.5893231   .1193409    -4.94   0.000    -.8232269   -.3554193
             625  |  -.2616774    .123594    -2.12   0.034    -.5039172   -.0194376
             630  |  -.5362956   .1177908    -4.55   0.000    -.7671614   -.3054298
             640  |   -.631367   .1146265    -5.51   0.000    -.8560309   -.4067031
             651  |  -.3610687   .1217579    -2.97   0.003    -.5997098   -.1224276
             652  |  -.3598099   .1217524    -2.96   0.003    -.5984403   -.1211795
             660  |  -.5194734   .1187973    -4.37   0.000    -.7523118    -.286635
             663  |  -.5013983   .1223258    -4.10   0.000    -.7411524   -.2616442
             666  |  -.7704597   .1164497    -6.62   0.000     -.998697   -.5422225
             670  |  -.7474566   .1215356    -6.15   0.000    -.9856619   -.5092513
             679  |    -.37366   .1259831    -2.97   0.003    -.6205824   -.1267376
             690  |  -.7638477   .1208527    -6.32   0.000    -1.000715   -.5269807
             692  |  -.7208363   .1268689    -5.68   0.000    -.9694948   -.4721779
             694  |  -.7623074   .1239117    -6.15   0.000     -1.00517   -.5194449
             696  |   -.863968   .1219678    -7.08   0.000    -1.103021   -.6249155
             698  |   -.617877   .1222245    -5.06   0.000    -.8574327   -.3783214
             701  |  -.4712334   .1239296    -3.80   0.000     -.714131   -.2283359
             702  |  -.2082338   .1301075    -1.60   0.109    -.4632398    .0467722
             704  |  -.2726407   .1265999    -2.15   0.031    -.5207718   -.0245095
             705  |  -.4003609   .1199007    -3.34   0.001    -.6353619   -.1653599
             710  |   .2043786   .1447659     1.41   0.158    -.0793573    .4881145
             712  |  -.2991444   .1296836    -2.31   0.021    -.5533196   -.0449692
             732  |  -.7386709   .1135304    -6.51   0.000    -.9611863   -.5161554
             740  |  -1.022958   .1126871    -9.08   0.000    -1.243821   -.8020957
             750  |  -.3729951   .1246118    -2.99   0.003    -.6172296   -.1287605
             760  |   -.236332   .1295278    -1.82   0.068    -.4902018    .0175378
             770  |  -.3464179   .1222421    -2.83   0.005     -.586008   -.1068277
             771  |   -.307302   .1231199    -2.50   0.013    -.5486126   -.0659915
             780  |  -.3660446    .122662    -2.98   0.003    -.6064577   -.1256314
             790  |   -.156508   .1273753    -1.23   0.219    -.4061591    .0931431
             800  |  -.5144073   .1176654    -4.37   0.000    -.7450272   -.2837873
             811  |  -.3020379   .1288613    -2.34   0.019    -.5546014   -.0494744
             820  |  -.5789758   .1203464    -4.81   0.000    -.8148505   -.3431011
             830  |  -.8525895   .1466147    -5.82   0.000    -1.139949   -.5652301
             840  |  -.4795827   .1193952    -4.02   0.000    -.7135931   -.2455723
             850  |  -.5032988   .1218669    -4.13   0.000    -.7421535   -.2644441
             900  |  -.6987796   .1302254    -5.37   0.000    -.9540166   -.4435425
             910  |  -.2595687   .1282656    -2.02   0.043    -.5109647   -.0081727
             920  |   -.775821   .1164016    -6.67   0.000    -1.003964   -.5476779
             940  |  -.2201923   .1310189    -1.68   0.093    -.4769846       .0366
             950  |  -.4226467   .1255577    -3.37   0.001    -.6687353   -.1765581
                  |
            _cons |   3.846076   .1200417    32.04   0.000     3.610798    4.081353
-----------------------------------------------------------------------------------

.                                         /* Figure R27 */
>                         /* Marginal effects */
>                         grinter clji, inter(clji_democ) con(cxconst) scheme(s1mono) yline(0, lpattern(dot) lcolor(gs8)) kdensity nomean clevel(90)
>                                 title(Figure R27. Marginal Effects of Property Rights on FDI (LJI).);

.                                         graph save Figure_R27, replace;
(note: file Figure_R27.gph not found)
(file Figure_R27.gph saved)

.         /* Table R7 Model 4 */                          
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtpcse ln_FDI_net_inflows c.clji_democ#year c.clji#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 i.ccode, p het;

Number of gaps in sample:  62

Linear regression, heteroskedastic panels corrected standard errors

Group variable:   ccode                         Number of obs     =      4,148
Time variable:    year                          Number of groups  =        149
Panels:           heteroskedastic (unbalanced)  Obs per group:
Autocorrelation:  no autocorrelation                          min =          1
                                                              avg =  27.838926
                                                              max =         40
Estimated covariances      =       149          R-squared         =     0.6866
Estimated autocorrelations =         0          Wald chi2(236)    =   17113.84
Estimated coefficients     =       237          Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------
                  |            Het-corrected
ln_FDI_net_infl~s |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
year#c.clji_democ |
            1970  |  -.0362663    .031486    -1.15   0.249    -.0979777    .0254452
            1971  |  -.0690463   .0348721    -1.98   0.048    -.1373943   -.0006983
            1972  |  -.0708157   .0344018    -2.06   0.040     -.138242   -.0033894
            1973  |  -.0680843   .0338463    -2.01   0.044    -.1344218   -.0017467
            1974  |  -.0634861   .0325882    -1.95   0.051    -.1273578    .0003855
            1975  |  -.0567386   .0305472    -1.86   0.063      -.11661    .0031329
            1976  |  -.0606128   .0289135    -2.10   0.036    -.1172822   -.0039433
            1977  |  -.0419971   .0249988    -1.68   0.093    -.0909938    .0069996
            1978  |  -.0456613   .0249913    -1.83   0.068    -.0946433    .0033208
            1979  |  -.0404557   .0235615    -1.72   0.086    -.0866354     .005724
            1980  |  -.0330314   .0230048    -1.44   0.151    -.0781199    .0120571
            1981  |  -.0359135   .0241577    -1.49   0.137    -.0832617    .0114347
            1982  |  -.0399825   .0232857    -1.72   0.086    -.0856217    .0056567
            1983  |  -.0358814   .0230219    -1.56   0.119    -.0810036    .0092408
            1984  |  -.0373126    .023097    -1.62   0.106     -.082582    .0079567
            1985  |  -.0382878   .0227078    -1.69   0.092    -.0827943    .0062186
            1986  |  -.0225392   .0222111    -1.01   0.310    -.0660721    .0209938
            1987  |  -.0088458   .0220904    -0.40   0.689    -.0521421    .0344506
            1988  |  -.0011917   .0215473    -0.06   0.956    -.0434236    .0410401
            1989  |   .0044601   .0217906     0.20   0.838    -.0382487     .047169
            1990  |  -.0001855   .0220606    -0.01   0.993    -.0434235    .0430524
            1991  |  -.0280405   .0225708    -1.24   0.214    -.0722785    .0161975
            1992  |   -.025648   .0228986    -1.12   0.263    -.0705283    .0192324
            1993  |  -.0004999   .0235383    -0.02   0.983    -.0466342    .0456344
            1994  |   .0017703   .0232365     0.08   0.939    -.0437723    .0473129
            1995  |   .0100388   .0227751     0.44   0.659    -.0345997    .0546772
            1996  |   .0176903   .0204822     0.86   0.388    -.0224542    .0578347
            1997  |   .0368195   .0197472     1.86   0.062    -.0018842    .0755232
            1998  |   .0811767   .0211159     3.84   0.000     .0397903     .122563
            1999  |   .1199186   .0209359     5.73   0.000     .0788849    .1609523
            2000  |   .1779217   .0217604     8.18   0.000      .135272    .2205714
            2001  |   .0909371   .0213786     4.25   0.000     .0490359    .1328384
            2002  |   .0683937   .0207233     3.30   0.001     .0277767    .1090106
            2003  |    .037858   .0208301     1.82   0.069    -.0029682    .0786842
            2004  |   .0107739   .0207086     0.52   0.603    -.0298143     .051362
            2005  |   .1087061   .0214832     5.06   0.000     .0665998    .1508125
            2006  |     .17844   .0215868     8.27   0.000     .1361307    .2207493
            2007  |   .2475713   .0219267    11.29   0.000     .2045957    .2905469
            2008  |   .1716048    .022507     7.62   0.000     .1274919    .2157177
            2009  |    .113631   .0247792     4.59   0.000     .0650647    .1621973
                  |
      year#c.clji |
            1970  |  -.1639707   .0968331    -1.69   0.090    -.3537601    .0258186
            1971  |  -.2538156   .1072686    -2.37   0.018    -.4640581    -.043573
            1972  |  -.2766454    .105947    -2.61   0.009    -.4842977   -.0689932
            1973  |  -.2615678     .10358    -2.53   0.012    -.4645808   -.0585548
            1974  |  -.2147177    .102421    -2.10   0.036    -.4154591   -.0139762
            1975  |  -.2613428    .097024    -2.69   0.007    -.4515063   -.0711794
            1976  |  -.2595221   .0936482    -2.77   0.006    -.4430692    -.075975
            1977  |  -.2037625   .0828363    -2.46   0.014    -.3661187   -.0414063
            1978  |  -.2020907   .0800783    -2.52   0.012    -.3590412   -.0451402
            1979  |  -.1774118   .0752081    -2.36   0.018    -.3248169   -.0300066
            1980  |  -.1539259   .0745737    -2.06   0.039    -.3000877   -.0077641
            1981  |  -.2000671   .0777337    -2.57   0.010    -.3524224   -.0477119
            1982  |  -.2381772   .0754959    -3.15   0.002    -.3861465   -.0902079
            1983  |  -.2313564   .0754529    -3.07   0.002    -.3792414   -.0834713
            1984  |  -.2131216   .0750332    -2.84   0.005     -.360184   -.0660591
            1985  |  -.1945897   .0746356    -2.61   0.009    -.3408727   -.0483067
            1986  |  -.1604379   .0723516    -2.22   0.027    -.3022444   -.0186313
            1987  |  -.1104321   .0713714    -1.55   0.122    -.2503175    .0294533
            1988  |  -.1002535   .0705675    -1.42   0.155    -.2385633    .0380562
            1989  |  -.0887064   .0714683    -1.24   0.215    -.2287816    .0513688
            1990  |  -.1009419   .0721403    -1.40   0.162    -.2423344    .0404506
            1991  |  -.1449111   .0697701    -2.08   0.038    -.2816579   -.0081642
            1992  |  -.1759625   .0696476    -2.53   0.012    -.3124693   -.0394557
            1993  |  -.1671446   .0665703    -2.51   0.012    -.2976199   -.0366693
            1994  |  -.1510164   .0648299    -2.33   0.020    -.2780805   -.0239522
            1995  |  -.0872193   .0628581    -1.39   0.165    -.2104189    .0359803
            1996  |  -.0862235   .0587031    -1.47   0.142    -.2012794    .0288324
            1997  |  -.0567248    .059442    -0.95   0.340     -.173229    .0597793
            1998  |   .0429231   .0597098     0.72   0.472    -.0741059    .1599521
            1999  |    .136231   .0594423     2.29   0.022     .0197262    .2527358
            2000  |   .2997629   .0600204     4.99   0.000     .1821251    .4174006
            2001  |   .1198481   .0615737     1.95   0.052    -.0008341    .2405303
            2002  |   .0617392   .0603916     1.02   0.307    -.0566262    .1801046
            2003  |   -.007968    .061293    -0.13   0.897    -.1281001    .1121641
            2004  |  -.0839557   .0615106    -1.36   0.172    -.2045143    .0366028
            2005  |   .0755592   .0603503     1.25   0.211    -.0427252    .1938436
            2006  |   .1588096    .059357     2.68   0.007      .042472    .2751472
            2007  |   .2655444   .0598694     4.44   0.000     .1482025    .3828863
            2008  |   .1299058   .0606225     2.14   0.032     .0110879    .2487237
            2009  |  -.0462807   .0608491    -0.76   0.447    -.1655428    .0729813
                  |
          cxconst |   .0055146   .0025001     2.21   0.027     .0006144    .0104148
    cln_GDP2005US |   .0219562   .0106325     2.07   0.039     .0011169    .0427956
cln_GDP_pc2005USD |   .0519433   .0168341     3.09   0.002     .0189491    .0849376
       cGDPgrowth |  -.0003463    .000293    -1.18   0.237    -.0009205    .0002279
     cTradePctGDP |   .0010816   .0001074    10.08   0.000     .0008712     .001292
          ckaopen |  -.0022975   .0027321    -0.84   0.400    -.0076524    .0030574
     cln_resource |  -.0233986   .0041306    -5.66   0.000    -.0314944   -.0153028
       cln_battle |   .0007979   .0006399     1.25   0.212    -.0004562     .002052
                  |
            ccode |
              20  |  -.7292677   .0945572    -7.71   0.000    -.9145964   -.5439391
              41  |  -.7730794   .1070275    -7.22   0.000    -.9828494   -.5633093
              42  |  -.9673502   .0975653    -9.91   0.000    -1.158575   -.7761257
              51  |  -.9521973   .1018376    -9.35   0.000    -1.151795   -.7525993
              52  |  -.9507499   .1057302    -8.99   0.000    -1.157977   -.7435225
              70  |  -.7465955   .0949612    -7.86   0.000     -.932716    -.560475
              90  |  -.9438809   .0967994    -9.75   0.000    -1.133604   -.7541576
              91  |  -.9425993    .100818    -9.35   0.000    -1.140199   -.7449995
              92  |  -.9737907   .0986491    -9.87   0.000    -1.167139   -.7804421
              93  |  -.9451372   .1006591    -9.39   0.000    -1.142425    -.747849
              94  |   -1.03297    .102793   -10.05   0.000    -1.234441   -.8314992
              95  |  -1.084678    .103795   -10.45   0.000    -1.288113   -.8812439
             100  |  -.8970499   .0934008    -9.60   0.000    -1.080112   -.7139878
             101  |  -.9307195   .0937871    -9.92   0.000    -1.114539   -.7469002
             110  |  -.9408652    .112261    -8.38   0.000    -1.160893   -.7208376
             130  |  -.9324812   .0960142    -9.71   0.000    -1.120666   -.7442969
             135  |  -.9220434   .0941147    -9.80   0.000    -1.106505    -.737582
             140  |  -.7288031   .0995978    -7.32   0.000    -.9240111   -.5335951
             145  |  -.8689188   .0995945    -8.72   0.000     -1.06412   -.6737171
             150  |  -.9460336   .1005032    -9.41   0.000    -1.143016    -.749051
             155  |  -.9393972   .0942381    -9.97   0.000    -1.124101   -.7546939
             160  |  -.9221853   .0924955    -9.97   0.000    -1.103473   -.7408976
             165  |  -1.025517   .1002266   -10.23   0.000    -1.221958   -.8290769
             200  |  -.3675753   .1103732    -3.33   0.001    -.5839029   -.1512478
             205  |  -1.014082   .1058471    -9.58   0.000    -1.221538    -.806625
             210  |  -.5864536   .1362685    -4.30   0.000    -.8535349   -.3193723
             211  |  -.3970725   .1437286    -2.76   0.006    -.6787754   -.1153697
             220  |  -.6721903   .1054556    -6.37   0.000    -.8788794   -.4655011
             225  |  -1.004072    .118303    -8.49   0.000    -1.235941   -.7722021
             230  |  -.7525003   .0955527    -7.88   0.000    -.9397802   -.5652204
             235  |   -1.06246   .0947539   -11.21   0.000    -1.248174   -.8767454
             255  |  -.6807142   .1418649    -4.80   0.000    -.9587644   -.4026641
             290  |  -.9154877   .0924427    -9.90   0.000    -1.096672   -.7343034
             305  |  -1.035435   .0997214   -10.38   0.000    -1.230886   -.8399851
             310  |  -.9456422   .1100826    -8.59   0.000      -1.1614   -.7298843
             316  |  -1.119568   .0994192   -11.26   0.000    -1.314426   -.9247096
             317  |  -1.173828   .1007599   -11.65   0.000    -1.371314   -.9763421
             325  |  -.9464698   .0918802   -10.30   0.000    -1.126552    -.766388
             339  |  -.9284522   .1014775    -9.15   0.000    -1.127344   -.7295599
             343  |  -1.060768    .103759   -10.22   0.000    -1.264132   -.8574039
             344  |  -1.076021   .0988283   -10.89   0.000     -1.26972   -.8823208
             349  |  -1.312351   .1095952   -11.97   0.000    -1.527153   -1.097548
             350  |  -1.102144   .0948132   -11.62   0.000    -1.287975   -.9163136
             352  |  -1.138395   .1095651   -10.39   0.000    -1.353139   -.9236518
             355  |  -1.006285   .0980495   -10.26   0.000    -1.198459    -.814112
             359  |  -1.016849   .1049872    -9.69   0.000     -1.22262   -.8110777
             360  |  -.9416679   .0941216   -10.00   0.000    -1.126143   -.7571929
             365  |  -.6130445    .114187    -5.37   0.000     -.836847    -.389242
             366  |  -1.245052   .1102022   -11.30   0.000    -1.461044   -1.029059
             367  |  -1.124238   .1035159   -10.86   0.000    -1.327125   -.9213502
             368  |  -1.177935    .103749   -11.35   0.000    -1.381279   -.9745907
             369  |  -.8965421   .0970245    -9.24   0.000    -1.086707   -.7063775
             370  |  -1.061231   .0992813   -10.69   0.000    -1.255819   -.8666431
             371  |  -.8854704   .1030808    -8.59   0.000    -1.087505   -.6834358
             372  |   -.884806   .1020313    -8.67   0.000    -1.084784   -.6848283
             373  |  -.8492595   .1016937    -8.35   0.000    -1.048575   -.6499436
             375  |  -1.057829   .0990806   -10.68   0.000    -1.252023   -.8636342
             380  |  -.9679134   .0973084    -9.95   0.000    -1.158634   -.7771924
             385  |  -1.038034   .0981657   -10.57   0.000    -1.230435   -.8456324
             390  |  -1.082799   .0999751   -10.83   0.000    -1.278746   -.8868513
             402  |  -.9517666   .1152704    -8.26   0.000    -1.177692   -.7258408
             404  |  -.8335035    .108546    -7.68   0.000     -1.04625   -.6207572
             411  |  -.9948923   .1174805    -8.47   0.000     -1.22515   -.7646347
             420  |  -.8781195   .1112162    -7.90   0.000    -1.096099   -.6601398
             432  |  -.8315874   .1016055    -8.18   0.000    -1.030731   -.6324442
             433  |  -.9059439   .1001429    -9.05   0.000     -1.10222   -.7096674
             434  |  -.8435305   .1010481    -8.35   0.000    -1.041581   -.6454798
             435  |  -.8666312   .1061319    -8.17   0.000    -1.074646   -.6586164
             436  |  -.8329168   .1021811    -8.15   0.000    -1.033188   -.6326456
             437  |   -.947659   .0970868    -9.76   0.000    -1.137946   -.7573723
             438  |  -.7909801   .1036704    -7.63   0.000    -.9941704   -.5877899
             439  |  -.8314855   .1012176    -8.21   0.000    -1.029868   -.6331027
             450  |  -.8408924   .1082402    -7.77   0.000    -1.053039   -.6287455
             451  |  -.8216313   .1041758    -7.89   0.000    -1.025812   -.6174505
             452  |  -.8601713   .0999894    -8.60   0.000    -1.056147   -.6641956
             461  |  -.8848547   .1041996    -8.49   0.000    -1.089082   -.6806273
             471  |  -.8851347   .0978601    -9.04   0.000    -1.076937   -.6933324
             475  |  -.7984847   .0978385    -8.16   0.000    -.9902447   -.6067248
             481  |  -.9941603   .1057228    -9.40   0.000    -1.201373   -.7869475
             482  |  -.8209223   .1049101    -7.83   0.000    -1.026542   -.6153024
             483  |  -.8896035   .1029776    -8.64   0.000    -1.091436    -.687771
             484  |  -.9358162      .1042    -8.98   0.000    -1.140044    -.731588
             490  |  -.8633018   .0970565    -8.89   0.000    -1.053529   -.6730744
             500  |  -.8203991   .1011026    -8.11   0.000    -1.018556   -.6222417
             501  |  -.8941184   .0985947    -9.07   0.000    -1.087361   -.7008763
             510  |  -.8569547   .0990194    -8.65   0.000    -1.051029   -.6628802
             516  |  -.7635396   .1056563    -7.23   0.000    -.9706222   -.5564571
             517  |  -.7965285   .1030003    -7.73   0.000    -.9984054   -.5946517
             522  |  -.9087463   .1120045    -8.11   0.000    -1.128271   -.6892216
             530  |  -.8012004   .1031209    -7.77   0.000    -1.003314   -.5990871
             531  |  -.8463027   .1062801    -7.96   0.000    -1.054608   -.6379974
             540  |  -1.015621   .0985579   -10.30   0.000    -1.208791   -.8224514
             541  |  -.8233763   .1018691    -8.08   0.000    -1.023036   -.6237165
             551  |  -.8661154   .0998883    -8.67   0.000    -1.061893   -.6703379
             552  |  -.8872897   .0999874    -8.87   0.000    -1.083262    -.691318
             553  |  -.8248985   .1034083    -7.98   0.000    -1.027575   -.6222219
             560  |   -.979426   .0923402   -10.61   0.000    -1.160409   -.7984426
             565  |  -1.029392   .1026136   -10.03   0.000    -1.230511   -.8282732
             570  |  -.9779737   .1112822    -8.79   0.000    -1.196083   -.7598647
             571  |  -1.033349   .1057039    -9.78   0.000    -1.240525    -.826173
             572  |  -1.007318   .1098275    -9.17   0.000    -1.222576   -.7920599
             580  |  -.8416635   .1012247    -8.31   0.000     -1.04006   -.6432667
             581  |  -.8525221   .1117527    -7.63   0.000    -1.071553   -.6334909
             590  |   -1.06791   .1095351    -9.75   0.000    -1.282595   -.8532247
             600  |  -.9457512   .0952725    -9.93   0.000    -1.132482   -.7590206
             615  |  -.9295983   .0942804    -9.86   0.000    -1.114384   -.7448121
             616  |  -.9666506   .0976921    -9.89   0.000    -1.158124   -.7751776
             620  |  -1.051049   .1006746   -10.44   0.000    -1.248368   -.8537304
             625  |  -.8814697   .0989705    -8.91   0.000    -1.075448   -.6874911
             630  |  -.9339093   .0933361   -10.01   0.000    -1.116845   -.7509739
             640  |  -.9918812   .0915492   -10.83   0.000    -1.171314   -.8124481
             651  |  -.8433579    .096795    -8.71   0.000    -1.033073   -.6536432
             652  |  -.8902792   .0971216    -9.17   0.000    -1.080634   -.6999243
             660  |    -1.0031   .0997374   -10.06   0.000    -1.198581   -.8076181
             663  |  -1.005639   .1016639    -9.89   0.000    -1.204896    -.806381
             666  |  -1.073662    .098313   -10.92   0.000    -1.266352   -.8809717
             670  |  -1.003058   .0996431   -10.07   0.000    -1.198355   -.8077611
             679  |  -.8897841   .1002137    -8.88   0.000    -1.086199   -.6933688
             690  |  -1.075557   .1029503   -10.45   0.000    -1.277336   -.8737778
             692  |  -1.100594   .1126385    -9.77   0.000    -1.321361   -.8798266
             694  |  -1.081844   .1122569    -9.64   0.000    -1.301863   -.8618245
             696  |  -1.108717   .1057347   -10.49   0.000    -1.315953   -.9014808
             698  |  -1.000864   .1032061    -9.70   0.000    -1.203145    -.798584
             701  |  -1.066081   .1061834   -10.04   0.000    -1.274197   -.8579654
             702  |   -.875446   .1059681    -8.26   0.000     -1.08314   -.6677523
             704  |  -.8926957   .1016924    -8.78   0.000    -1.092009   -.6933823
             705  |  -.8617781   .0973028    -8.86   0.000    -1.052488   -.6710681
             710  |  -.1487104    .136558    -1.09   0.276    -.4163591    .1189383
             712  |  -.9585622   .1066118    -8.99   0.000    -1.167518   -.7496069
             732  |   -1.03989   .0915498   -11.36   0.000    -1.219325   -.8604561
             740  |  -1.102179    .090257   -12.21   0.000    -1.279079   -.9252782
             750  |   -.804515   .1032477    -7.79   0.000    -1.006877   -.6021531
             760  |  -.9330849   .1132528    -8.24   0.000    -1.155056   -.7111135
             770  |  -.8685341   .0978011    -8.88   0.000    -1.060221   -.6768475
             771  |  -.8516924   .0988189    -8.62   0.000    -1.045374   -.6580109
             780  |  -.9216867   .0981171    -9.39   0.000    -1.113993   -.7293806
             790  |  -.8256985   .1018002    -8.11   0.000    -1.025223   -.6261737
             800  |  -.9388733   .0939543    -9.99   0.000     -1.12302   -.7547263
             811  |   -.893317   .1034912    -8.63   0.000    -1.096156    -.690478
             820  |  -.9715718   .0963034   -10.09   0.000    -1.160323   -.7828206
             830  |  -1.015491   .1321083    -7.69   0.000    -1.274419    -.756564
             840  |  -.9426187   .0952087    -9.90   0.000    -1.129224    -.756013
             850  |  -.8770761   .0977489    -8.97   0.000     -1.06866   -.6854918
             900  |  -.8717489   .1134335    -7.69   0.000    -1.094075   -.6494233
             910  |  -.8718754   .1028754    -8.48   0.000    -1.073507   -.6702434
             920  |  -1.066884   .1023375   -10.43   0.000    -1.267462   -.8663061
             940  |  -.9705291   .1162537    -8.35   0.000    -1.198382   -.7426761
             950  |  -.9816979   .1083381    -9.06   0.000    -1.194037   -.7693591
                  |
            _cons |   4.349021   .0987278    44.05   0.000     4.155518    4.542524
-----------------------------------------------------------------------------------

.                 gen time= 1 if e(sample)==1;
(4,000 missing values generated)

.                 /* Figure R28 */
>                 /* generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*cxconst + _b[1970b.year#clji] if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                                         forvalues year=1971(1)2009  {;
  2.                         replace MEslope_t = (_b[`year'.year#clji_democ])*cxconst + _b[`year'.year#clji] if year==`year';
  3.                         };
(201 real changes made, 77 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 76 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(197 real changes made, 59 to missing)
(197 real changes made, 57 to missing)
(196 real changes made, 50 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 46 to missing)
(196 real changes made, 45 to missing)
(196 real changes made, 48 to missing)
(197 real changes made, 51 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                                                 replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                         /* Plot slope over time */
>                         collapse MEslope_t, by(xconst year time);

.                                 twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lc
> olor(gs14)
>                                 || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R28. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(LJI: Panel Corrected
>  Standard Errors)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R28, replace;
(note: file Figure_R28.gph not found)
(file Figure_R28.gph saved)

.                                                                         /* Sample: Add Energy Consumption variable */
> 
>         /* Table R8 Model 1 */
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows cPRdemoc cefw2legalrights cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle cln_pec 
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  69.790894  
Iteration 1:   log likelihood =  69.790894  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,312
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,312
                                                              avg =    1,312.0
                                                              max =      1,312

                                                Wald chi2(11)     =     244.38
Log likelihood =  69.790894                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          cPRdemoc |   .0087883   .0025596     3.43   0.001     .0037716     .013805
  cefw2legalrights |   -.017061   .0075391    -2.26   0.024    -.0318373   -.0022846
           cxconst |   -.010176   .0059936    -1.70   0.090    -.0219232    .0015712
     cln_GDP2005US |   .0780642   .0226443     3.45   0.001     .0336823    .1224461
 cln_GDP_pc2005USD |   .0105708   .0184447     0.57   0.567    -.0255801    .0467216
        cGDPgrowth |   .0001881   .0016212     0.12   0.908    -.0029893    .0033656
      cTradePctGDP |   .0010159   .0003238     3.14   0.002     .0003813    .0016504
           ckaopen |   .0110845   .0069684     1.59   0.112    -.0025733    .0247423
      cln_resource |  -.0461056   .0106321    -4.34   0.000    -.0669442    -.025267
        cln_battle |  -.0054389   .0025456    -2.14   0.033    -.0104282   -.0004496
           cln_pec |    .024952    .016399     1.52   0.128    -.0071895    .0570935
             _cons |   3.375318   .0295527   114.21   0.000     3.317395     3.43324
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1612179   .0122672      .1388816    .1871466
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0772727    .017859      .0491246    .1215496
-----------------------------+------------------------------------------------
                sd(Residual) |   .2062054   .0042774      .1979901    .2147617
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 409.20                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -109.5818           .  -109.5818  -109.5818

.                                         /* Figure R29 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                         /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b08 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R29. Marginal Effects of Property Rights on FDI." "(Energy Consumption)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R29, replace;
(note: file Figure_R29.gph not found)
(file Figure_R29.gph saved)

.                 /* Table R8 Model 2 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.cPRdemoc#year c.cefw2legalrights#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_b
> attle cln_pec
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  208.06207  
Iteration 1:   log likelihood =  208.06207  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,312
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,312
                                                              avg =    1,312.0
                                                              max =      1,312

                                                Wald chi2(37)     =     573.59
Log likelihood =  208.06207                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------------
     ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        year#c.cPRdemoc |
                  1970  |  -.0046572   .0079206    -0.59   0.557    -.0201813    .0108669
                  1975  |  -.0032646   .0071418    -0.46   0.648    -.0172623    .0107331
                  1980  |  -.0036713   .0059432    -0.62   0.537    -.0153197    .0079771
                  1985  |  -.0036025   .0054335    -0.66   0.507    -.0142521     .007047
                  1990  |   .0006355   .0054051     0.12   0.906    -.0099583    .0112293
                  1995  |  -.0022497    .007333    -0.31   0.759    -.0166222    .0121227
                  2000  |   .0292167   .0065925     4.43   0.000     .0162958    .0421377
                  2001  |   .0084844   .0059431     1.43   0.153    -.0031638    .0201326
                  2002  |   .0071089   .0058513     1.21   0.224    -.0043594    .0185772
                  2003  |   .0009076   .0056678     0.16   0.873    -.0102012    .0120163
                  2004  |  -.0077903   .0059383    -1.31   0.190    -.0194291    .0038485
                  2005  |   .0095364   .0062039     1.54   0.124     -.002623    .0216957
                  2006  |   .0169435   .0065448     2.59   0.010      .004116     .029771
                  2007  |   .0280037   .0059798     4.68   0.000     .0162835     .039724
                        |
year#c.cefw2legalrights |
                  1970  |  -.0562651   .0202847    -2.77   0.006    -.0960224   -.0165078
                  1975  |  -.0660565   .0207771    -3.18   0.001    -.1067788   -.0253342
                  1980  |   -.045894   .0141286    -3.25   0.001    -.0735855   -.0182025
                  1985  |  -.0602959   .0130731    -4.61   0.000    -.0859187   -.0346731
                  1990  |  -.0352018   .0127929    -2.75   0.006    -.0602753   -.0101282
                  1995  |  -.0233711    .017902    -1.31   0.192    -.0584584    .0117162
                  2000  |   .0350255   .0158818     2.21   0.027     .0038977    .0661532
                  2001  |   .0107314   .0139727     0.77   0.442    -.0166545    .0381173
                  2002  |  -.0005971   .0135876    -0.04   0.965    -.0272284    .0260342
                  2003  |  -.0066341   .0132574    -0.50   0.617    -.0326181    .0193498
                  2004  |  -.0174882   .0141439    -1.24   0.216    -.0452099    .0102334
                  2005  |   .0167478   .0142583     1.17   0.240    -.0111981    .0446936
                  2006  |   .0401272   .0154016     2.61   0.009     .0099406    .0703139
                  2007  |   .0646318   .0141847     4.56   0.000     .0368303    .0924333
                        |
                cxconst |  -.0034538    .005624    -0.61   0.539    -.0144766    .0075691
          cln_GDP2005US |   .0892609   .0217609     4.10   0.000     .0466103    .1319115
      cln_GDP_pc2005USD |  -.0185135    .018246    -1.01   0.310     -.054275     .017248
             cGDPgrowth |    .000013   .0014915     0.01   0.993    -.0029103    .0029363
           cTradePctGDP |    .001024   .0003083     3.32   0.001     .0004197    .0016282
                ckaopen |   .0088157   .0063815     1.38   0.167    -.0036918    .0213233
           cln_resource |  -.0376328   .0102018    -3.69   0.000     -.057628   -.0176376
             cln_battle |  -.0031568   .0023663    -1.33   0.182    -.0077946    .0014811
                cln_pec |   .0185779    .015517     1.20   0.231    -.0118349    .0489907
                  _cons |   3.368378   .0260767   129.17   0.000     3.317268    3.419487
-----------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1668519   .0120084      .1449005    .1921288
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0579201   .0163898      .0332631    .1008546
-----------------------------+------------------------------------------------
                sd(Residual) |   .1835695   .0038124      .1762474    .1911958
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 509.08                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(6,836 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(6836 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -334.1241           .  -334.1241  -334.1241

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,941 missing values generated)
(5,371 missing values generated)

.                 /* Figure R30 */        
>                 /* generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#cPRdemoc])*cxconst + _b[1970b.year#cefw2legalrights] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                                         forvalues year=1975(5)2000  {;
  2.                                         replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(201 real changes made, 71 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 72 to missing)
(196 real changes made, 49 to missing)
(197 real changes made, 50 to missing)

.                                         forvalues year=2001/2007  {;
  2.                                         replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)

.                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                 /* Plot slope over time */
>                         collapse MEslope_t, by(xconst year time);

.                                 twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lc
> olor(gs14)
>                                 || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R30. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(Energy Consumption)"
> )
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R30, replace;
(note: file Figure_R30.gph not found)
(file Figure_R30.gph saved)

.                                                 /* Table R8 Model 3 */                          
>         /* lji */
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows clji_democ clji cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle cln_pec 
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1422.0743  
Iteration 1:   log likelihood =  1422.0743  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      3,893
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      3,893
                                                              avg =    3,893.0
                                                              max =      3,893

                                                Wald chi2(11)     =     307.09
Log likelihood =  1422.0743                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        clji_democ |   .0552862   .0103454     5.34   0.000     .0350096    .0755628
              clji |   .0107253   .0479383     0.22   0.823    -.0832321    .1046828
           cxconst |  -.0066286   .0040619    -1.63   0.103    -.0145898    .0013326
     cln_GDP2005US |   .0398556   .0107678     3.70   0.000     .0187511    .0609602
 cln_GDP_pc2005USD |   .0217279   .0107201     2.03   0.043     .0007169    .0427389
        cGDPgrowth |  -.0006529   .0005204    -1.25   0.210    -.0016727     .000367
      cTradePctGDP |   .0007315   .0001548     4.72   0.000      .000428    .0010349
           ckaopen |   .0080001   .0030574     2.62   0.009     .0020078    .0139924
      cln_resource |  -.0264861   .0050748    -5.22   0.000    -.0364325   -.0165398
        cln_battle |  -.0019731    .001072    -1.84   0.066    -.0040741    .0001278
           cln_pec |   .0044997   .0066724     0.67   0.500     -.008578    .0175774
             _cons |   3.388996    .016485   205.58   0.000     3.356686    3.421306
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1286052   .0091398      .1118831    .1478265
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0534963   .0073189      .0409138    .0699482
-----------------------------+------------------------------------------------
                sd(Residual) |   .1572407   .0018417      .1536722    .1608922
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1501.32               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -2814.149           .  -2814.149  -2814.149

.                                         /* Figure R31 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b08 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                 /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R31. Marginal Effects of Property Rights on FDI." "(LJI: Energy Consumption)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R31, replace;
(note: file Figure_R31.gph not found)
(file Figure_R31.gph saved)

.                 /* Table R8 Model 4 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.clji_democ#year c.clji#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle cln_
> pec
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1807.4394  
Iteration 1:   log likelihood =  1808.4356  
Iteration 2:   log likelihood =   1808.486  
Iteration 3:   log likelihood =   1808.486  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      3,893
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      3,893
                                                              avg =    3,893.0
                                                              max =      3,893

                                                Wald chi2(85)     =    1881.26
Log likelihood =   1808.486                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
 year#c.clji_democ |
             1970  |  -.0217945   .0245843    -0.89   0.375    -.0699789    .0263899
             1971  |  -.0530142   .0239473    -2.21   0.027      -.09995   -.0060785
             1972  |  -.0549187    .023445    -2.34   0.019      -.10087   -.0089674
             1973  |   -.052159   .0232951    -2.24   0.025    -.0978166   -.0065013
             1974  |  -.0463456    .022867    -2.03   0.043    -.0911641   -.0015272
             1975  |  -.0410325   .0222474    -1.84   0.065    -.0846365    .0025716
             1976  |  -.0468791   .0212606    -2.20   0.027    -.0885491   -.0052091
             1977  |  -.0288769   .0200007    -1.44   0.149    -.0680775    .0103238
             1978  |  -.0326505   .0204726    -1.59   0.111    -.0727759     .007475
             1979  |  -.0279175   .0201392    -1.39   0.166    -.0673897    .0115546
             1980  |  -.0207332   .0200573    -1.03   0.301    -.0600447    .0185784
             1981  |  -.0229121   .0197348    -1.16   0.246    -.0615916    .0157675
             1982  |  -.0287955     .01971    -1.46   0.144    -.0674264    .0098353
             1983  |   -.026562   .0198379    -1.34   0.181    -.0654435    .0123196
             1984  |  -.0288934   .0199469    -1.45   0.147    -.0679886    .0102019
             1985  |  -.0304747   .0196941    -1.55   0.122    -.0690745     .008125
             1986  |  -.0168552   .0195762    -0.86   0.389    -.0552238    .0215134
             1987  |  -.0031805   .0196943    -0.16   0.872    -.0417807    .0354196
             1988  |   .0036653   .0195541     0.19   0.851    -.0346601    .0419907
             1989  |   .0101487   .0200418     0.51   0.613    -.0291326    .0494299
             1990  |   .0048462   .0202037     0.24   0.810    -.0347523    .0444448
             1991  |  -.0233916   .0218313    -1.07   0.284    -.0661802     .019397
             1992  |  -.0224785   .0224263    -1.00   0.316    -.0664333    .0214763
             1993  |   .0012469   .0236513     0.05   0.958    -.0451088    .0476026
             1994  |   .0032245   .0239186     0.13   0.893    -.0436551     .050104
             1995  |   .0099737   .0236464     0.42   0.673    -.0363724    .0563199
             1996  |   .0147647   .0217395     0.68   0.497    -.0278439    .0573733
             1997  |   .0336018   .0210249     1.60   0.110    -.0076063    .0748099
             1998  |    .077367   .0225117     3.44   0.001     .0332449    .1214891
             1999  |   .1160695   .0224169     5.18   0.000     .0721333    .1600057
             2000  |    .174963   .0223602     7.82   0.000     .1311378    .2187882
             2001  |   .0877114   .0223255     3.93   0.000     .0439543    .1314685
             2002  |   .0672923   .0217361     3.10   0.002     .0246903    .1098942
             2003  |   .0362775   .0216426     1.68   0.094    -.0061413    .0786963
             2004  |   .0094774   .0219178     0.43   0.665    -.0334808    .0524356
             2005  |   .1070537   .0225185     4.75   0.000     .0629183    .1511892
             2006  |   .1778208   .0226188     7.86   0.000     .1334888    .2221527
             2007  |   .2471666   .0226892    10.89   0.000     .2026965    .2916367
                   |
       year#c.clji |
             1970  |  -.1747595   .0769374    -2.27   0.023     -.325554   -.0239651
             1971  |  -.2574623   .0755059    -3.41   0.001    -.4054512   -.1094735
             1972  |  -.2796018   .0744012    -3.76   0.000    -.4254255   -.1337782
             1973  |  -.2640619   .0737315    -3.58   0.000    -.4085729   -.1195508
             1974  |  -.2167033   .0740276    -2.93   0.003    -.3617947    -.071612
             1975  |  -.2658237   .0724173    -3.67   0.000     -.407759   -.1238884
             1976  |  -.2614116   .0705973    -3.70   0.000    -.3997797   -.1230435
             1977  |   -.207962   .0674571    -3.08   0.002    -.3401755   -.0757486
             1978  |  -.2046078   .0673975    -3.04   0.002    -.3367046   -.0725111
             1979  |  -.1800831   .0661753    -2.72   0.007    -.3097843   -.0503818
             1980  |  -.1550885   .0664581    -2.33   0.020     -.285344    -.024833
             1981  |  -.1967716   .0658974    -2.99   0.003    -.3259281   -.0676152
             1982  |  -.2341723   .0657089    -3.56   0.000    -.3629594   -.1053853
             1983  |  -.2239462   .0663511    -3.38   0.001    -.3539919   -.0939005
             1984  |  -.2057098   .0663132    -3.10   0.002    -.3356812   -.0757384
             1985  |  -.1865036   .0659054    -2.83   0.005    -.3156758   -.0573314
             1986  |   -.148262   .0654491    -2.27   0.023      -.27654    -.019984
             1987  |  -.0974852   .0656821    -1.48   0.138    -.2262197    .0312493
             1988  |  -.0852422    .065757    -1.30   0.195    -.2141236    .0436393
             1989  |  -.0738373   .0670416    -1.10   0.271    -.2052365    .0575618
             1990  |  -.0810932   .0674165    -1.20   0.229     -.213227    .0510407
             1991  |  -.1285718   .0698968    -1.84   0.066     -.265567    .0084233
             1992  |  -.1568035   .0710769    -2.21   0.027    -.2961117   -.0174953
             1993  |  -.1466285   .0720833    -2.03   0.042    -.2879092   -.0053478
             1994  |  -.1309773   .0724434    -1.81   0.071    -.2729637    .0110092
             1995  |   -.061746   .0714046    -0.86   0.387    -.2016965    .0782044
             1996  |  -.0627058     .06709    -0.93   0.350    -.1941997    .0687881
             1997  |  -.0316547   .0664289    -0.48   0.634     -.161853    .0985436
             1998  |   .0712701   .0684998     1.04   0.298     -.062987    .2055273
             1999  |   .1651241   .0684622     2.41   0.016     .0309406    .2993077
             2000  |   .3286254   .0674057     4.88   0.000     .1965126    .4607383
             2001  |   .1506158   .0678119     2.22   0.026      .017707    .2835247
             2002  |   .0976719   .0663158     1.47   0.141    -.0323046    .2276485
             2003  |   .0280731   .0664378     0.42   0.673    -.1021426    .1582887
             2004  |  -.0482499   .0672857    -0.72   0.473    -.1801276    .0836277
             2005  |   .1143934    .067304     1.70   0.089    -.0175199    .2463068
             2006  |    .196455   .0668198     2.94   0.003     .0654906    .3274194
             2007  |   .3049867   .0667592     4.57   0.000      .174141    .4358324
                   |
           cxconst |   .0042467    .003684     1.15   0.249    -.0029738    .0114672
     cln_GDP2005US |   .0589792   .0098985     5.96   0.000     .0395785    .0783798
 cln_GDP_pc2005USD |  -.0073009   .0100924    -0.72   0.469    -.0270816    .0124798
        cGDPgrowth |  -.0003062   .0004818    -0.64   0.525    -.0012505    .0006382
      cTradePctGDP |   .0009006   .0001383     6.51   0.000     .0006295    .0011716
           ckaopen |   .0003271   .0027856     0.12   0.907    -.0051327    .0057868
      cln_resource |   -.022879   .0046622    -4.91   0.000    -.0320167   -.0137413
        cln_battle |  -.0001576   .0009684    -0.16   0.871    -.0020557    .0017405
           cln_pec |   .0046559   .0062465     0.75   0.456     -.007587    .0168988
             _cons |   3.402074   .0134033   253.82   0.000     3.375804    3.428344
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1249378   .0078297      .1104969     .141266
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   3.99e-06   .0015704             0           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .1437843   .0016624      .1405626    .1470798
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1713.35               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(4,255 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(4255 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -3438.972           .  -3438.972  -3438.972

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,039 missing values generated)
(584 missing values generated)

.                 /* Figure R32 */
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*cxconst + _b[1970b.year#clji] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                                         forvalues year=1971(1)2007  {;
  2.                                                 replace MEslope_t = (_b[`year'.year#clji_democ])*cxconst + _b[`year'.year#clji] + REyear_yr if year==`year';
  3.                         };
(201 real changes made, 77 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 76 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(197 real changes made, 59 to missing)
(197 real changes made, 57 to missing)
(196 real changes made, 50 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 46 to missing)
(196 real changes made, 45 to missing)
(196 real changes made, 48 to missing)
(197 real changes made, 51 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)

.                                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                                                 /* Plot slope over time */
>                         collapse MEslope_t, by(xconst year time);

.                                 twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lc
> olor(gs14)
>                                 || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R32. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(LJI: Energy Consumpt
> ion)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R32, replace;
(note: file Figure_R32.gph not found)
(file Figure_R32.gph saved)

.                                                                                 /* Sample: Add Proportion Rural Population variable */
>         
>         /* Table R9 Model 1 */
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows cPRdemoc cefw2legalrights cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle cruralpopul 
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  90.833236  
Iteration 1:   log likelihood =  90.833236  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,533
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,533
                                                              avg =    1,533.0
                                                              max =      1,533

                                                Wald chi2(10)     =          .
Log likelihood =  90.833236                     Prob > chi2       =          .

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          cPRdemoc |   .0077657   .0024958     3.11   0.002      .002874    .0126574
  cefw2legalrights |  -.0165515   .0072737    -2.28   0.023    -.0308078   -.0022953
           cxconst |  -.0117344   .0057968    -2.02   0.043    -.0230959   -.0003729
     cln_GDP2005US |   .0973027   .0133201     7.30   0.000     .0711959    .1234096
 cln_GDP_pc2005USD |   .0210605   .0189505     1.11   0.266    -.0160818    .0582027
        cGDPgrowth |  -.0000981   .0014369    -0.07   0.946    -.0029144    .0027181
      cTradePctGDP |   .0010948   .0003085     3.55   0.000     .0004901    .0016995
           ckaopen |   .0072927   .0066307     1.10   0.271    -.0057032    .0202887
      cln_resource |  -.0413325   .0101628    -4.07   0.000    -.0612512   -.0214139
        cln_battle |  -.0041719   .0023578    -1.77   0.077    -.0087932    .0004494
       cruralpopul |   3.29e-10   1.83e-10     1.80   0.072    -2.92e-11    6.87e-10
             _cons |   3.390463   .0294463   115.14   0.000     3.332749    3.448176
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1692582   .0124257      .1465753    .1954514
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0781323   .0170468      .0509467    .1198242
-----------------------------+------------------------------------------------
                sd(Residual) |   .2057568   .0039171      .1982209    .2135792
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 551.09                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -151.6665           .  -151.6665  -151.6665

.                                         /* Figure R33 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                         /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b08 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R33. Marginal Effects of Property Rights on FDI." "(Rural Population)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R33, replace;
(note: file Figure_R33.gph not found)
(file Figure_R33.gph saved)

.                 /* Table R9 Model 2 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.cPRdemoc#year c.cefw2legalrights#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_b
> attle cruralpopul
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  245.65026  
Iteration 1:   log likelihood =  245.65026  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,533
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,533
                                                              avg =    1,533.0
                                                              max =      1,533

                                                Wald chi2(40)     =          .
Log likelihood =  245.65026                     Prob > chi2       =          .

-----------------------------------------------------------------------------------------
     ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        year#c.cPRdemoc |
                  1970  |  -.0060132   .0079284    -0.76   0.448    -.0215526    .0095263
                  1975  |  -.0050888   .0071312    -0.71   0.475    -.0190656     .008888
                  1980  |  -.0064912   .0058654    -1.11   0.268    -.0179872    .0050049
                  1985  |  -.0046832   .0054098    -0.87   0.387    -.0152861    .0059197
                  1990  |    .000676   .0053937     0.13   0.900    -.0098954    .0112474
                  1995  |  -.0031518   .0072958    -0.43   0.666    -.0174514    .0111478
                  2000  |   .0278526   .0065569     4.25   0.000     .0150014    .0407039
                  2001  |   .0066281   .0058922     1.12   0.261    -.0049204    .0181766
                  2002  |   .0049985    .005801     0.86   0.389    -.0063711    .0163682
                  2003  |  -.0009579   .0056214    -0.17   0.865    -.0119756    .0100598
                  2004  |  -.0096392     .00589    -1.64   0.102    -.0211833     .001905
                  2005  |   .0079929   .0061784     1.29   0.196    -.0041166    .0201024
                  2006  |   .0151905   .0065252     2.33   0.020     .0024013    .0279796
                  2007  |   .0267805   .0059742     4.48   0.000     .0150712    .0384898
                  2008  |   .0168724   .0065926     2.56   0.010     .0039511    .0297937
                  2009  |   .0002574   .0078485     0.03   0.974    -.0151254    .0156402
                        |
year#c.cefw2legalrights |
                  1970  |  -.0595318   .0202372    -2.94   0.003    -.0991959   -.0198676
                  1975  |  -.0740807   .0205158    -3.61   0.000     -.114291   -.0338705
                  1980  |  -.0535353   .0138196    -3.87   0.000    -.0806212   -.0264495
                  1985  |  -.0646824   .0129294    -5.00   0.000    -.0900236   -.0393412
                  1990  |   -.035169   .0127121    -2.77   0.006    -.0600843   -.0102537
                  1995  |  -.0217409   .0177713    -1.22   0.221     -.056572    .0130902
                  2000  |   .0376341   .0157261     2.39   0.017     .0068115    .0684567
                  2001  |   .0143054   .0138098     1.04   0.300    -.0127613    .0413722
                  2002  |   .0027006   .0134212     0.20   0.841    -.0236045    .0290058
                  2003  |  -.0042281   .0131056    -0.32   0.747    -.0299147    .0214584
                  2004  |  -.0147553   .0139826    -1.06   0.291    -.0421607    .0126501
                  2005  |    .018976   .0141273     1.34   0.179    -.0087129     .046665
                  2006  |   .0432363   .0152639     2.83   0.005     .0133196    .0731531
                  2007  |   .0663776   .0140827     4.71   0.000      .038776    .0939792
                  2008  |   .0322072    .015407     2.09   0.037     .0020101    .0624043
                  2009  |   .0123011   .0178317     0.69   0.490    -.0226485    .0472506
                        |
                cxconst |  -.0040539   .0054643    -0.74   0.458    -.0147636    .0066559
          cln_GDP2005US |   .1051692   .0133415     7.88   0.000     .0790203    .1313182
      cln_GDP_pc2005USD |  -.0127957   .0188902    -0.68   0.498    -.0498198    .0242284
             cGDPgrowth |  -.0000797   .0013292    -0.06   0.952    -.0026849    .0025254
           cTradePctGDP |   .0010922   .0002944     3.71   0.000     .0005152    .0016691
                ckaopen |   .0059011   .0060961     0.97   0.333     -.006047    .0178492
           cln_resource |  -.0335421    .009796    -3.42   0.001     -.052742   -.0143422
             cln_battle |  -.0012595   .0021953    -0.57   0.566    -.0055621    .0030432
            cruralpopul |   2.59e-10   1.83e-10     1.42   0.157    -9.94e-11    6.17e-10
                  _cons |   3.378414    .026466   127.65   0.000     3.326541    3.430286
-----------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1757187   .0123011      .1531899    .2015607
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0588201   .0156949      .0348659    .0992319
-----------------------------+------------------------------------------------
                sd(Residual) |   .1842794   .0035119      .1775232    .1912927
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 677.70                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(6,615 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(6615 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -401.3005           .  -401.3005  -401.3005

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,941 missing values generated)
(4,981 missing values generated)

.                 /* Figure R34 */        
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#cPRdemoc])*cxconst + _b[1970b.year#cefw2legalrights] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                                         forvalues year=1975(5)2000  {;
  2.                                                 replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(201 real changes made, 71 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 72 to missing)
(196 real changes made, 49 to missing)
(197 real changes made, 50 to missing)

.                                                 forvalues year=2001/2009  {;
  2.                                                 replace MEslope_t = (_b[`year'.year#cPRdemoc])*cxconst + _b[`year'.year#cefw2legalrights] + REyear_yr if year==`year';
  3.                         };
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                 /* Plot slope over time */
>                         collapse MEslope_t, by(xconst year time);

.                                 twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lc
> olor(gs14)
>                                 || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                                 || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                                 || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                                 || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                                 || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                         xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Marginal Effect of Property Rights on FDI")
>                                         title("Figure R34. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(Rural Population)")
>                                         note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                         "lines indicate greater levels of Democracy.");

.                                                 graph save Figure_R34, replace;
(note: file Figure_R34.gph not found)
(file Figure_R34.gph saved)

.                                                         /* Table R9 Model 3 */                          
>         /* lji */
>         /* Fixed model */
>         use `temp', clear;

.         xtmixed ln_FDI_net_inflows clji_democ clji cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle cruralpopul 
>                 || _all: R.ccode || _all: R.year, mle;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1389.8411  
Iteration 1:   log likelihood =  1389.8411  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,148
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,148
                                                              avg =    4,148.0
                                                              max =      4,148

                                                Wald chi2(10)     =          .
Log likelihood =  1389.8411                     Prob > chi2       =          .

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        clji_democ |   .0546996   .0104449     5.24   0.000      .034228    .0751712
              clji |   .0307065   .0479383     0.64   0.522    -.0632508    .1246639
           cxconst |  -.0085002   .0040818    -2.08   0.037    -.0165003   -.0005001
     cln_GDP2005US |   .0379346   .0080592     4.71   0.000     .0221389    .0537303
 cln_GDP_pc2005USD |    .032512   .0112125     2.90   0.004      .010536     .054488
        cGDPgrowth |  -.0008661   .0005221    -1.66   0.097    -.0018894    .0001572
      cTradePctGDP |   .0007825    .000153     5.12   0.000     .0004827    .0010823
           ckaopen |   .0061446   .0030247     2.03   0.042     .0002162     .012073
      cln_resource |  -.0256859   .0050345    -5.10   0.000    -.0355533   -.0158185
        cln_battle |  -.0015251   .0010735    -1.42   0.155    -.0036291     .000579
       cruralpopul |   3.45e-10   1.28e-10     2.70   0.007     9.42e-11    5.95e-10
             _cons |   3.398326    .017093   198.81   0.000     3.364825    3.431828
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1346278   .0094402      .1173404     .154462
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0563523   .0075621      .0433197    .0733056
-----------------------------+------------------------------------------------
                sd(Residual) |   .1622974   .0018382      .1587342    .1659406
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1653.57               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                                 matrix B = e(b);

.                 matrix C = e(V);

.                 matrix k = e(k);

.                 matrix L = e(ll);

.                 svmat k;

.                 svmat L;

.                 gen AIC = 2*k1 - 2*L1;
(8,147 missing values generated)

.                 sum AIC;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         AIC |          1   -2749.682           .  -2749.682  -2749.682

.                                         /* Figure R35 */
>                         /* Collapse to show the impact of changing Democ from their Min to their Max */
>                         collapse (mean) cxconst;

.                         expand 7;
(6 observations created)

.                         replace cxconst = _n-4;
(7 real changes made)

.                                                 /* Take 1000 draws from actual values */
>                         expand 1000;
(6,993 observations created)

.                         drawnorm bxz bx bz b01 b02 b03 b04 b05 b06 b07 b08 b00 b10 b20 resid , means(B) cov(C);

.                                                         /* Generate the marginal effects variable and change over the full range of Property Rights */
>                         gen gamma = bx + cxconst*(bxz);

.                         collapse (mean) gamma (sd) sd_gamma = gamma, by(cxconst);

.                         /* Generate 95% confidence intervals */
>                         gen gamma_lo = gamma - 1.645*sd_gamma ;

.                         gen gamma_hi = gamma + 1.645*sd_gamma;

.                         replace cxconst = cxconst + 4;
(7 real changes made)

.                                 /* create a kdensity plot */
>                         mkmat cxconst-gamma_hi , matrix(collapsed) ;

.                         use `temp', clear;

.                         keep cxconst;

.                         replace cxconst = cxconst + 4;
(5,668 real changes made)

.                         rename cxconst kdensity_xconst;

.                         svmat collapsed, names(col);

.                                                         /* Graph marginal effects */
>                                 twoway lowess gamma cxconst, scheme(s1mono) lcolor(black) lwidth(medthick)
>                                 || lowess gamma_lo cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || lowess gamma_hi cxconst, lcolor(gray) lwidth(medium) lpattern(dash)
>                                 || kdensity kdensity_xconst, n(7) yaxis(2) lpattern(shortdash_dot) lcolor(gs8) lwidth(thin) 
>                                 yline(0, lpattern(dot) lcolor(gs8))  xtitle("Level of Democracy")
>                                 legend(off)
>                                 ytitle("Kernal Density Estimate of Democracy", axis(2))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R35. Marginal Effects of Property Rights on FDI." "(LJI: Rural Population)")
>                                 note("Note: Dashed lines give 90% confidence interval. Light dashed-dot line displays the Kernal density" "estimate.")
>                                 ;

.                                         graph save Figure_R35, replace;
(note: file Figure_R35.gph not found)
(file Figure_R35.gph saved)

.                 /* Table R9 Model 4 */
>         /* Time-varying model */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.clji_democ#year c.clji#year cxconst cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle crur
> alpopul
>                 || _all: R.ccode || _all: R.year, mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1782.9686  
Iteration 1:   log likelihood =  1784.0111  
Iteration 2:   log likelihood =  1784.0559  
Iteration 3:   log likelihood =  1784.0559  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,148
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,148
                                                              avg =    4,148.0
                                                              max =      4,148

                                                Wald chi2(88)     =          .
Log likelihood =  1784.0559                     Prob > chi2       =          .

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
 year#c.clji_democ |
             1970  |  -.0233814   .0253963    -0.92   0.357    -.0731571    .0263944
             1971  |  -.0556596   .0247376    -2.25   0.024    -.1041444   -.0071747
             1972  |  -.0574364   .0242111    -2.37   0.018    -.1048892   -.0099836
             1973  |  -.0548472   .0240632    -2.28   0.023    -.1020101   -.0076842
             1974  |  -.0499515   .0236236    -2.11   0.034    -.0962529   -.0036501
             1975  |  -.0439676   .0229828    -1.91   0.056     -.089013    .0010778
             1976  |  -.0491857   .0219521    -2.24   0.025    -.0922109   -.0061604
             1977  |  -.0308336   .0206393    -1.49   0.135    -.0712858    .0096186
             1978  |  -.0345511   .0211323    -1.63   0.102    -.0759697    .0068674
             1979  |  -.0299376   .0207888    -1.44   0.150    -.0706828    .0108076
             1980  |  -.0231274   .0207013    -1.12   0.264    -.0637013    .0174465
             1981  |  -.0261216   .0203631    -1.28   0.200    -.0660326    .0137895
             1982  |  -.0315426    .020339    -1.55   0.121    -.0714063     .008321
             1983  |   -.029014   .0204675    -1.42   0.156    -.0691295    .0111016
             1984  |   -.031045   .0205528    -1.51   0.131    -.0713277    .0092377
             1985  |  -.0323245   .0202899    -1.59   0.111    -.0720921    .0074431
             1986  |  -.0179589   .0201486    -0.89   0.373    -.0574494    .0215315
             1987  |  -.0043867   .0202699    -0.22   0.829    -.0441149    .0353415
             1988  |   .0026354   .0201272     0.13   0.896    -.0368132     .042084
             1989  |   .0081061   .0206334     0.39   0.694    -.0323346    .0485467
             1990  |   .0024682   .0207651     0.12   0.905    -.0382305     .043167
             1991  |  -.0259298   .0224025    -1.16   0.247    -.0698379    .0179783
             1992  |  -.0250869   .0230135    -1.09   0.276    -.0701926    .0200188
             1993  |  -.0011016   .0243065    -0.05   0.964    -.0487415    .0465383
             1994  |   .0007054   .0245879     0.03   0.977     -.047486    .0488969
             1995  |   .0082706   .0242701     0.34   0.733    -.0392979     .055839
             1996  |   .0133007   .0222429     0.60   0.550    -.0302946    .0568961
             1997  |    .032204   .0215004     1.50   0.134     -.009936    .0743439
             1998  |   .0756749   .0230906     3.28   0.001     .0304181    .1209316
             1999  |    .114001   .0229864     4.96   0.000     .0689486    .1590535
             2000  |   .1722878   .0229572     7.50   0.000     .1272925    .2172831
             2001  |   .0853015   .0229093     3.72   0.000     .0404001    .1302028
             2002  |   .0635414   .0222763     2.85   0.004     .0198807     .107202
             2003  |   .0325198   .0221917     1.47   0.143    -.0109751    .0760147
             2004  |   .0053774   .0224939     0.24   0.811    -.0387097    .0494646
             2005  |   .1023507   .0231296     4.43   0.000     .0570176    .1476838
             2006  |   .1726394   .0232416     7.43   0.000     .1270868     .218192
             2007  |   .2415872   .0233273    10.36   0.000     .1958665    .2873079
             2008  |    .165665   .0242171     6.84   0.000     .1182004    .2131296
             2009  |   .1064388   .0256236     4.15   0.000     .0562175    .1566601
                   |
       year#c.clji |
             1970  |  -.1720976   .0789166    -2.18   0.029    -.3267713    -.017424
             1971  |  -.2584797   .0773871    -3.34   0.001    -.4101556   -.1068038
             1972  |  -.2812628   .0762084    -3.69   0.000    -.4306286    -.131897
             1973  |   -.266263   .0755537    -3.52   0.000    -.4143456   -.1181804
             1974  |  -.2199343   .0757548    -2.90   0.004    -.3684109   -.0714577
             1975  |  -.2656406   .0741543    -3.58   0.000    -.4109803   -.1203008
             1976  |  -.2607552   .0721903    -3.61   0.000    -.4022456   -.1192648
             1977  |  -.2060973   .0688918    -2.99   0.003    -.3411227   -.0710719
             1978  |  -.2043257   .0688744    -2.97   0.003    -.3393171   -.0693344
             1979  |  -.1794316   .0675961    -2.65   0.008    -.3119176   -.0469455
             1980  |  -.1542205    .067838    -2.27   0.023    -.2871805   -.0212605
             1981  |  -.1982869   .0672026    -2.95   0.003    -.3300015   -.0665723
             1982  |  -.2357321   .0670172    -3.52   0.000    -.3670833   -.1043809
             1983  |  -.2258787   .0676484    -3.34   0.001    -.3584671   -.0932903
             1984  |  -.2054065    .067648    -3.04   0.002    -.3379941   -.0728189
             1985  |  -.1861282   .0672156    -2.77   0.006    -.3178685    -.054388
             1986  |  -.1493749   .0667842    -2.24   0.025    -.2802695   -.0184804
             1987  |   -.098947   .0670001    -1.48   0.140    -.2302649    .0323708
             1988  |  -.0871203   .0670205    -1.30   0.194    -.2184781    .0442375
             1989  |  -.0740498   .0683523    -1.08   0.279    -.2080179    .0599183
             1990  |  -.0833764    .068586    -1.22   0.224    -.2178024    .0510497
             1991  |  -.1277591   .0713497    -1.79   0.073    -.2676019    .0120837
             1992  |  -.1557067   .0725527    -2.15   0.032    -.2979073   -.0135061
             1993  |  -.1451239   .0736651    -1.97   0.049    -.2895048   -.0007429
             1994  |  -.1288287   .0740795    -1.74   0.082     -.274022    .0163645
             1995  |  -.0623477   .0728923    -0.86   0.392     -.205214    .0805186
             1996  |    -.06083   .0682981    -0.89   0.373    -.1946918    .0730319
             1997  |  -.0297696   .0674857    -0.44   0.659    -.1620392    .1024999
             1998  |   .0724005   .0697844     1.04   0.300    -.0643743    .2091754
             1999  |   .1673867   .0697614     2.40   0.016     .0306569    .3041164
             2000  |   .3308751   .0687672     4.81   0.000     .1960938    .4656564
             2001  |   .1521423   .0691405     2.20   0.028     .0166295    .2876551
             2002  |   .0959319   .0676381     1.42   0.156    -.0366363       .2285
             2003  |    .026952   .0677762     0.40   0.691    -.1058869    .1597908
             2004  |  -.0482317   .0686338    -0.70   0.482    -.1827514     .086288
             2005  |   .1148312   .0687141     1.67   0.095     -.019846    .2495085
             2006  |     .19724   .0682689     2.89   0.004     .0634353    .3310446
             2007  |    .305826   .0682337     4.48   0.000     .1720905    .4395616
             2008  |   .1700031   .0697777     2.44   0.015     .0332414    .3067649
             2009  |  -.0060419   .0716011    -0.08   0.933    -.1463774    .1342936
                   |
           cxconst |    .003787   .0036994     1.02   0.306    -.0034637    .0110377
     cln_GDP2005US |   .0651525   .0074627     8.73   0.000     .0505258    .0797793
 cln_GDP_pc2005USD |  -.0058393   .0106377    -0.55   0.583    -.0266888    .0150102
        cGDPgrowth |  -.0003317   .0004838    -0.69   0.493      -.00128    .0006165
      cTradePctGDP |    .000966    .000137     7.05   0.000     .0006975    .0012345
           ckaopen |  -.0013122   .0027622    -0.48   0.635    -.0067259    .0041016
      cln_resource |  -.0219766   .0046597    -4.72   0.000    -.0311093   -.0128438
        cln_battle |   .0003852   .0009746     0.40   0.693    -.0015249    .0022953
       cruralpopul |   1.07e-10   1.23e-10     0.87   0.384    -1.34e-10    3.47e-10
             _cons |   3.403995   .0139795   243.50   0.000     3.376596    3.431395
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1314207   .0082536      .1161999    .1486352
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   2.95e-06   .0018167             0           .
-----------------------------+------------------------------------------------
                sd(Residual) |   .1490667   .0016682      .1458326    .1523725
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1861.09               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(4,000 missing values generated)

.                 egen id = group(ccode) if e(sample)==1;
(4000 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -3382.112           .  -3382.112  -3382.112

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,039 missing values generated)
(194 missing values generated)

.                 /* Figure R36 */        
>                 /* Generate marginal effects of PR*/
>                 gen MEslope_1970 = (_b[1970b.year#clji_democ])*cxconst + _b[1970b.year#clji] + REyear_yr if year==1970;
(8,027 missing values generated)

.                 gen MEslope_t=0;

.                                         forvalues year=1971(1)2009  {;
  2.                                         replace MEslope_t = (_b[`year'.year#clji_democ])*cxconst + _b[`year'.year#clji] + REyear_yr if year==`year';
  3.                         };
(201 real changes made, 77 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 75 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 76 to missing)
(201 real changes made, 74 to missing)
(201 real changes made, 73 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 71 to missing)
(201 real changes made, 69 to missing)
(201 real changes made, 70 to missing)
(201 real changes made, 72 to missing)
(197 real changes made, 59 to missing)
(197 real changes made, 57 to missing)
(196 real changes made, 50 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 49 to missing)
(196 real changes made, 46 to missing)
(196 real changes made, 45 to missing)
(196 real changes made, 48 to missing)
(197 real changes made, 51 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 50 to missing)
(197 real changes made, 48 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 49 to missing)
(197 real changes made, 47 to missing)
(197 real changes made, 43 to missing)
(197 real changes made, 44 to missing)
(195 real changes made, 41 to missing)
(195 real changes made, 41 to missing)

.                                         replace MEslope_t=MEslope_1970 if year==1970;
(201 real changes made, 80 to missing)

.                                         /* Plot slope over time */
>                 collapse MEslope_t, by(xconst year time);

.                         twoway connected MEslope_t year if year<2010 & xconst==1 & time==1, connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs14) lcolor(gs1
> 4)
>                         || connected MEslope_t year if year<2010 & xconst==2 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs12) lcolor(gs12)
>                         || connected MEslope_t year if year<2010 & xconst==3 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                         || connected MEslope_t year if year<2010 & xconst==4 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs8) lcolor(gs8)
>                         || connected MEslope_t year if year<2010 & xconst==5 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs6) lcolor(gs6)
>                         || connected MEslope_t year if year<2010 & xconst==6 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs4) lcolor(gs4)
>                         || connected MEslope_t year if year<2010 & xconst==7 & time==1, connect(L) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2) 
>                                 xtitle("Year") legend(off) yline(0, lpattern(dot) lcolor(gs8))
>                                 ytitle("Marginal Effect of Property Rights on FDI")
>                                 title("Figure R36. Time-varying Marginal Effect of Property" "Rights at Different Levels of Democracy on FDI." "(LJI: Rural Population)")
>                                 note("Note: Displayed value is the marginal effect of Property Rights when interacted with Democracy. Darker" 
>                                 "lines indicate greater levels of Democracy.");

.                                         graph save Figure_R36, replace;
(note: file Figure_R36.gph not found)
(file Figure_R36.gph saved)

.                                                                                 /* Sample: No interaction */
>         
>         /* Table R10 Model 1 */
>         /* Time-varying, no interaction */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.cefw2legalrights#year c.cxconst#year cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year , mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  223.86715  
Iteration 1:   log likelihood =  223.86715  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      1,533
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      1,533
                                                              avg =    1,533.0
                                                              max =      1,533

                                                Wald chi2(39)     =     539.93
Log likelihood =  223.86715                     Prob > chi2       =     0.0000

-----------------------------------------------------------------------------------------
     ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
year#c.cefw2legalrights |
                  1970  |  -.0718353   .0257849    -2.79   0.005    -.1223727   -.0212978
                  1975  |  -.0731128    .021026    -3.48   0.001    -.1143229   -.0319027
                  1980  |  -.0489382   .0161171    -3.04   0.002    -.0805272   -.0173492
                  1985  |  -.0660196   .0150526    -4.39   0.000    -.0955222   -.0365169
                  1990  |  -.0374993   .0135583    -2.77   0.006     -.064073   -.0109255
                  1995  |  -.0284818   .0146025    -1.95   0.051    -.0571022    .0001386
                  2000  |    .075516   .0128125     5.89   0.000     .0504038    .1006281
                  2001  |   .0156883   .0117412     1.34   0.181     -.007324    .0387005
                  2002  |   .0033652   .0115123     0.29   0.770    -.0191985     .025929
                  2003  |  -.0093018   .0113359    -0.82   0.412    -.0315198    .0129162
                  2004  |  -.0327573   .0113705    -2.88   0.004    -.0550429   -.0104716
                  2005  |   .0240255   .0133561     1.80   0.072     -.002152    .0502031
                  2006  |   .0564628   .0135328     4.17   0.000      .029939    .0829866
                  2007  |   .0844571   .0135125     6.25   0.000     .0579731    .1109411
                  2008  |   .0420002   .0143829     2.92   0.003     .0138102    .0701902
                  2009  |   .0048678   .0154609     0.31   0.753    -.0254351    .0351706
                        |
         year#c.cxconst |
                  1970  |  -.0036908   .0181127    -0.20   0.839    -.0391911    .0318095
                  1975  |  -.0285227   .0144966    -1.97   0.049    -.0569355   -.0001099
                  1980  |  -.0150801   .0111719    -1.35   0.177    -.0369767    .0068164
                  1985  |  -.0113835   .0106039    -1.07   0.283    -.0321668    .0093997
                  1990  |  -.0071644   .0106235    -0.67   0.500     -.027986    .0136572
                  1995  |  -.0117191   .0120944    -0.97   0.333    -.0354238    .0119855
                  2000  |   .0065527   .0127768     0.51   0.608    -.0184892    .0315947
                  2001  |   .0073214   .0121402     0.60   0.546     -.016473    .0311158
                  2002  |   .0042273   .0119534     0.35   0.724    -.0192009    .0276556
                  2003  |  -.0044205    .011969    -0.37   0.712    -.0278792    .0190383
                  2004  |  -.0079088   .0115978    -0.68   0.495    -.0306401    .0148225
                  2005  |  -.0000111   .0115527    -0.00   0.999     -.022654    .0226318
                  2006  |   .0062911    .011441     0.55   0.582    -.0161328     .028715
                  2007  |   .0184375   .0115174     1.60   0.109    -.0041361    .0410111
                  2008  |   .0118732   .0119705     0.99   0.321    -.0115885    .0353349
                  2009  |   .0000321   .0132524     0.00   0.998    -.0259421    .0260063
                        |
          cln_GDP2005US |   .1141131   .0121954     9.36   0.000     .0902105    .1380157
      cln_GDP_pc2005USD |   -.018335   .0174528    -1.05   0.293    -.0525418    .0158718
             cGDPgrowth |  -.0008309   .0013415    -0.62   0.536    -.0034602    .0017985
           cTradePctGDP |   .0010599    .000298     3.56   0.000     .0004759     .001644
                ckaopen |   .0014986   .0064122     0.23   0.815    -.0110691    .0140664
           cln_resource |  -.0302333   .0099761    -3.03   0.002    -.0497861   -.0106804
             cln_battle |  -.0013903    .002215    -0.63   0.530    -.0057315     .002951
                  _cons |    3.37043   .0270783   124.47   0.000     3.317357    3.423502
-----------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1808652   .0125177      .1579222    .2071414
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |    .065514      .0162      .0403508    .1063692
-----------------------------+------------------------------------------------
                sd(Residual) |   .1865199    .003545      .1796996     .193599
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 718.43                Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(6,615 missing values generated)

.                 egen id1 = group(ccode) if e(sample)==1;
(6615 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1   -361.7343           .  -361.7343  -361.7343

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,941 missing values generated)
(4,981 missing values generated)

.                                                         /* Figure R37 */        
>                         /* Generate marginal effects of PR*/
>                         gen RLslope_1970 = _b[1970b.year#cefw2legalrights] if year==1970;
(7,947 missing values generated)

.                         gen Dslope_1970 = _b[1970b.year#cxconst] if year==1970;
(7,947 missing values generated)

.                         gen RLslope_t=0;

.                         gen Dslope_t=0;

.                                 forvalues year=1975(5)2000  {;
  2.                                         replace RLslope_t = _b[`year'.year#cefw2legalrights] if year==`year';
  3.                                 replace Dslope_t = _b[`year'.year#cxconst] if year==`year';
  4.                                 };
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(196 real changes made)
(196 real changes made)
(197 real changes made)
(197 real changes made)

.                                                 forvalues year=2001/2009  {;
  2.                                 replace RLslope_t = _b[`year'.year#cefw2legalrights] if year==`year';
  3.                                 replace Dslope_t = _b[`year'.year#cxconst] if year==`year';
  4.                                 };
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(195 real changes made)
(195 real changes made)
(195 real changes made)
(195 real changes made)

.                                 replace RLslope_t=RLslope_1970 if year==1970;
(201 real changes made)

.                                         replace Dslope_t=Dslope_1970 if year==1970;
(201 real changes made)

.                                                         /* Plot slope over time */              
>                                 twoway connected RLslope_t year if year<2010 & time==1, sort connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2
> )
>                                 || connected Dslope_t year if year<2010 & time==1, sort connect(L) lpattern(dash) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 xtitle("Year") legend(lab(1 "Rule of Law") lab(2 "Democracy")) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Coefficient")
>                                         title("Figure R37. Time-varying Coefficients without Interaction");

.                                         graph save Figure_R37, replace;
(note: file Figure_R37.gph not found)
(file Figure_R37.gph saved)

.                                 /* Table R10 Model 2 */         
>         /* Time-varying, no interaction */
>         /* LJI */
>                 use `temp', clear;

.                 xtmixed ln_FDI_net_inflows c.lji#year c.cxconst#year cln_GDP2005US cln_GDP_pc2005USD cGDPgrowth cTradePctGDP ckaopen cln_resource cln_battle
>                 || _all: R.ccode || _all: R.year , mle ;

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  1701.4799  
Iteration 1:   log likelihood =  1701.4799  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      4,148
Group variable: _all                            Number of groups  =          1

                                                Obs per group:
                                                              min =      4,148
                                                              avg =    4,148.0
                                                              max =      4,148

                                                Wald chi2(87)     =    1019.22
Log likelihood =  1701.4799                     Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
ln_FDI_net_inflows |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        year#c.lji |
             1970  |  -.0644603   .1441436    -0.45   0.655    -.3469766    .2180561
             1971  |   -.217598    .147173    -1.48   0.139    -.5060517    .0708557
             1972  |  -.2217177   .1426091    -1.55   0.120    -.5012263     .057791
             1973  |  -.2326787   .1324596    -1.76   0.079    -.4922948    .0269373
             1974  |  -.2192667   .1324106    -1.66   0.098    -.4787867    .0402533
             1975  |  -.2161489   .1313239    -1.65   0.100     -.473539    .0412412
             1976  |  -.2388635   .1257414    -1.90   0.057     -.485312    .0075851
             1977  |  -.1872696   .1248442    -1.50   0.134    -.4319597    .0574204
             1978  |  -.1594563   .1267374    -1.26   0.208    -.4078571    .0889444
             1979  |  -.1645982   .1153253    -1.43   0.154    -.3906316    .0614352
             1980  |   -.135117   .1105024    -1.22   0.221    -.3516978    .0814638
             1981  |  -.1605267   .1157688    -1.39   0.166    -.3874294     .066376
             1982  |  -.2172611   .1076968    -2.02   0.044     -.428343   -.0061793
             1983  |  -.2006514   .1081963    -1.85   0.064    -.4127121    .0114094
             1984  |  -.1659441   .1081484    -1.53   0.125    -.3779111    .0460229
             1985  |  -.1636021    .111664    -1.47   0.143    -.3824596    .0552553
             1986  |  -.1013576    .102452    -0.99   0.323    -.3021598    .0994445
             1987  |  -.0326199   .0997711    -0.33   0.744    -.2281677    .1629279
             1988  |  -.0108801   .0962136    -0.11   0.910    -.1994553    .1776951
             1989  |   .0057503   .0996118     0.06   0.954    -.1894851    .2009858
             1990  |   -.009322   .0967298    -0.10   0.923    -.1989089    .1802649
             1991  |  -.1218555   .0947199    -1.29   0.198     -.307503    .0637921
             1992  |  -.1484486   .0931348    -1.59   0.111    -.3309895    .0340923
             1993  |  -.0881908   .0940823    -0.94   0.349    -.2725888    .0962071
             1994  |  -.0658473   .0932718    -0.71   0.480    -.2486566     .116962
             1995  |  -.0062379   .0915558    -0.07   0.946    -.1856839    .1732081
             1996  |  -.0210803   .0890296    -0.24   0.813    -.1955752    .1534145
             1997  |   .0335972   .0923922     0.36   0.716    -.1474882    .2146826
             1998  |   .2264447   .0868048     2.61   0.009     .0563105    .3965789
             1999  |   .3915751   .0896674     4.37   0.000     .2158302    .5673199
             2000  |   .7164505   .0902782     7.94   0.000     .5395085    .8933925
             2001  |   .3426953   .0889352     3.85   0.000     .1683856     .517005
             2002  |   .2263553   .0879384     2.57   0.010     .0539992    .3987113
             2003  |   .1080765    .091229     1.18   0.236     -.070729    .2868821
             2004  |  -.0762087   .0914066    -0.83   0.404    -.2553624     .102945
             2005  |   .3382973    .088721     3.81   0.000     .1644072    .5121873
             2006  |   .6074899   .0864576     7.03   0.000     .4380362    .7769436
             2007  |   .8936758   .0895131     9.98   0.000     .7182334    1.069118
             2008  |   .5545784   .0876714     6.33   0.000     .3827456    .7264112
             2009  |   .2796533   .0880876     3.17   0.001     .1070047    .4523018
                   |
    year#c.cxconst |
             1970  |  -.0131682   .0187138    -0.70   0.482    -.0498465    .0235101
             1971  |  -.0026313   .0193693    -0.14   0.892    -.0405943    .0353318
             1972  |  -.0058621    .018406    -0.32   0.750    -.0419372    .0302131
             1973  |  -.0021406   .0166855    -0.13   0.898    -.0348435    .0305623
             1974  |   .0028541   .0165275     0.17   0.863    -.0295393    .0352474
             1975  |  -.0031977   .0162277    -0.20   0.844    -.0350035     .028608
             1976  |   .0009961   .0147881     0.07   0.946    -.0279881    .0299803
             1977  |   .0013514   .0148304     0.09   0.927    -.0277157    .0304184
             1978  |  -.0032901   .0154762    -0.21   0.832     -.033623    .0270428
             1979  |   .0011809   .0139235     0.08   0.932    -.0261087    .0284704
             1980  |   .0001577   .0130639     0.01   0.990     -.025447    .0257625
             1981  |  -.0022786   .0138472    -0.16   0.869    -.0294186    .0248614
             1982  |   .0005939    .012706     0.05   0.963    -.0243093    .0254972
             1983  |  -.0002018   .0127579    -0.02   0.987    -.0252068    .0248032
             1984  |  -.0030746    .012926    -0.24   0.812    -.0284091    .0222599
             1985  |  -.0006363   .0134973    -0.05   0.962    -.0270904    .0258179
             1986  |  -.0039065   .0121598    -0.32   0.748    -.0277392    .0199263
             1987  |  -.0067476   .0118648    -0.57   0.570    -.0300022     .016507
             1988  |  -.0075473   .0111613    -0.68   0.499    -.0294231    .0143285
             1989  |  -.0076224   .0117149    -0.65   0.515    -.0305832    .0153384
             1990  |  -.0071184   .0115123    -0.62   0.536     -.029682    .0154453
             1991  |  -.0002934   .0116667    -0.03   0.980    -.0231597    .0225728
             1992  |   .0006781     .01144     0.06   0.953    -.0217438    .0231001
             1993  |  -.0038098   .0123206    -0.31   0.757    -.0279578    .0203382
             1994  |  -.0052862   .0123832    -0.43   0.669    -.0295568    .0189844
             1995  |  -.0036901     .01209    -0.31   0.760    -.0273861    .0200059
             1996  |    .000523   .0115934     0.05   0.964    -.0221996    .0232456
             1997  |  -.0006517   .0119981    -0.05   0.957    -.0241675    .0228642
             1998  |  -.0085646   .0116282    -0.74   0.461    -.0313554    .0142262
             1999  |  -.0152039   .0119583    -1.27   0.204    -.0386418    .0082339
             2000  |  -.0352646   .0123468    -2.86   0.004    -.0594638   -.0110654
             2001  |  -.0139797   .0117584    -1.19   0.234    -.0370258    .0090664
             2002  |   -.006907   .0115679    -0.60   0.550    -.0295798    .0157657
             2003  |  -.0033233   .0119395    -0.28   0.781    -.0267244    .0200778
             2004  |   .0106481   .0117983     0.90   0.367    -.0124762    .0337724
             2005  |   -.016718   .0115354    -1.45   0.147    -.0393269     .005891
             2006  |  -.0366811   .0113471    -3.23   0.001    -.0589209   -.0144412
             2007  |  -.0562917   .0117844    -4.78   0.000    -.0793886   -.0331948
             2008  |  -.0333947   .0117727    -2.84   0.005    -.0564687   -.0103206
             2009  |  -.0252326    .012281    -2.05   0.040     -.049303   -.0011623
                   |
     cln_GDP2005US |   .0432935   .0075327     5.75   0.000     .0285296    .0580573
 cln_GDP_pc2005USD |    .015121   .0105018     1.44   0.150    -.0054621    .0357041
        cGDPgrowth |  -.0003955   .0004895    -0.81   0.419    -.0013549    .0005639
      cTradePctGDP |   .0005746    .000145     3.96   0.000     .0002904    .0008588
           ckaopen |  -.0066444   .0029241    -2.27   0.023    -.0123756   -.0009132
      cln_resource |  -.0208094   .0048073    -4.33   0.000    -.0302315   -.0113873
        cln_battle |  -.0003727   .0010007    -0.37   0.710    -.0023341    .0015887
             _cons |   3.411202   .0263305   129.55   0.000     3.359595    3.462809
------------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
_all: Identity               |
                 sd(R.ccode) |   .1392205   .0092477      .1222256    .1585784
-----------------------------+------------------------------------------------
_all: Identity               |
                  sd(R.year) |   .0706265   .0131791      .0489926    .1018134
-----------------------------+------------------------------------------------
                sd(Residual) |    .149555   .0016947        .14627    .1529139
------------------------------------------------------------------------------
LR test vs. linear model: chi2(2) = 1862.61               Prob > chi2 = 0.0000

Note: LR test is conservative and provided only for reference.

.                 gen time= 1 if e(sample)==1;
(4,000 missing values generated)

.                 egen id1 = group(ccode) if e(sample)==1;
(4000 missing values generated)

.                         matrix k_t = e(k);

.                 matrix L_t = e(ll);

.                 svmat k_t;

.                 svmat L_t;

.                 gen AIC_t = 2*k_t1 - 2*L_t1;
(8,147 missing values generated)

.                 sum AIC_t;

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       AIC_t |          1    -3220.96           .   -3220.96   -3220.96

.                         predict REccode_yr REyear_yr, reffects level(_all);
(2,039 missing values generated)
(194 missing values generated)

.                                         /* Figure R38 */        
>                 /* Generate marginal effects of PR*/
>                 gen RLslope_1970 = _b[1970b.year#lji] if year==1970;
(7,947 missing values generated)

.                 gen Dslope_1970 = _b[1970b.year#cxconst] if year==1970;
(7,947 missing values generated)

.                 gen RLslope_t=0;

.                 gen Dslope_t=0;

.                                 forvalues year=1971/2009  {;
  2.                         replace RLslope_t = _b[`year'.year#lji] if year==`year';
  3.                         replace Dslope_t = _b[`year'.year#cxconst] if year==`year';
  4.                         };
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(201 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(196 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(197 real changes made)
(195 real changes made)
(195 real changes made)
(195 real changes made)
(195 real changes made)

.                         replace RLslope_t=RLslope_1970 if year==1970;
(201 real changes made)

.                                 replace Dslope_t=Dslope_1970 if year==1970;
(201 real changes made)

.                                 /* Plot slope over time */                      
>                                 twoway connected RLslope_t year if year<2010 & time==1, sort connect(L) scheme(s1mono) lpattern(solid) msymbol(circle) mcolor(gs2) lcolor(gs2
> )
>                                 || connected Dslope_t year if year<2010 & time==1, sort connect(L) lpattern(dash) msymbol(circle) mcolor(gs10) lcolor(gs10)
>                                 xtitle("Year") legend(lab(1 "Rule of Law") lab(2 "Democracy")) yline(0, lpattern(dot) lcolor(gs8))
>                                         ytitle("Coefficient")
>                                         title("Figure R38. Time-varying Coefficients without Interaction" "(LJI)");

.                                                                         graph save Figure_R38, replace;
(note: file Figure_R38.gph not found)
(file Figure_R38.gph saved)

.                 log close;
      name:  <unnamed>
       log:  C:\Users\mdnieman\Desktop\PSRM replication\PSRM_Robust.log
  log type:  text
 closed on:  12 Dec 2017, 15:36:35
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
